Package org.bouncycastle.crypto.fips
Class FipsOutputMACCalculator<T>
- java.lang.Object
-
- org.bouncycastle.crypto.fips.FipsOutputMACCalculator<T>
-
- Type Parameters:
T- the parameters type associated with the final implementation of this calculator.
- All Implemented Interfaces:
OutputMACCalculator<T>
public abstract class FipsOutputMACCalculator<T> extends java.lang.Object implements OutputMACCalculator<T>
Base class for the approved mode OutputMACCalculator implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description byte[]getMAC()Return the MAC calculated on what has been written to the calculator's output stream.abstract intgetMAC(byte[] output, int off)Output the current MAC value for what has been written to the calculator's output stream.abstract intgetMACSize()Return the size of the MAC produced by this calculator in bytes.abstract UpdateOutputStreamgetMACStream()Returns a stream that will accept data for the purpose of calculating a MAC.abstract TgetParameters()Return the parameters for this MAC calculator.abstract voidreset()Reset the calculator back to its initial state.
-
-
-
Method Detail
-
getMAC
public byte[] getMAC()
Description copied from interface:OutputMACCalculatorReturn the MAC calculated on what has been written to the calculator's output stream.- Specified by:
getMACin interfaceOutputMACCalculator<T>- Returns:
- a MAC.
-
getParameters
public abstract T getParameters()
Description copied from interface:OutputMACCalculatorReturn the parameters for this MAC calculator.- Specified by:
getParametersin interfaceOutputMACCalculator<T>- Returns:
- the MAC calculator's parameters.
-
getMACSize
public abstract int getMACSize()
Description copied from interface:OutputMACCalculatorReturn the size of the MAC produced by this calculator in bytes.- Specified by:
getMACSizein interfaceOutputMACCalculator<T>- Returns:
- MAC length in bytes.
-
getMACStream
public abstract UpdateOutputStream getMACStream()
Description copied from interface:OutputMACCalculatorReturns a stream that will accept data for the purpose of calculating a MAC. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate the data on the fly as well.- Specified by:
getMACStreamin interfaceOutputMACCalculator<T>- Returns:
- an UpdateOutputStream
-
getMAC
public abstract int getMAC(byte[] output, int off)Description copied from interface:OutputMACCalculatorOutput the current MAC value for what has been written to the calculator's output stream.- Specified by:
getMACin interfaceOutputMACCalculator<T>- Parameters:
output- output array to write the MAC to.off- offset to start writing the MAC at.- Returns:
- the number of bytes written
-
reset
public abstract void reset()
Description copied from interface:OutputMACCalculatorReset the calculator back to its initial state.- Specified by:
resetin interfaceOutputMACCalculator<T>
-
-