Package org.bouncycastle.crypto.fips
Class FipsOutputDigestCalculator<T>
java.lang.Object
org.bouncycastle.crypto.fips.FipsOutputDigestCalculator<T>
- Type Parameters:
T- the parameters type associated with the final implementation of this calculator.
- All Implemented Interfaces:
Cloneable,OutputDigestCalculator<T>
public abstract class FipsOutputDigestCalculator<T>
extends Object
implements OutputDigestCalculator<T>
Base class for the approved mode OutputDigestCalculator implementations.
-
Method Summary
Modifier and TypeMethodDescriptionabstract FipsOutputDigestCalculator<T> clone()Return a clone of this calculator.final byte[]Return the digest calculated on what has been written to the calculator's output stream.abstract intgetDigest(byte[] output, int offSet) Output the current digest value for what has been written to the calculator's output stream.abstract intReturn the size, in bytes, of the internal block used by the digest in this calculator.abstract intReturn the size of the digest produced by this calculator in bytes.abstract UpdateOutputStreamReturns a stream that will accept data for the purpose of calculating a digest.abstract TReturn the parameters for this digest calculator.abstract voidreset()Reset the calculator back to its initial state.
-
Method Details
-
getDigest
public final byte[] getDigest()Description copied from interface:OutputDigestCalculatorReturn the digest calculated on what has been written to the calculator's output stream.- Specified by:
getDigestin interfaceOutputDigestCalculator<T>- Returns:
- a digest.
-
getParameters
Description copied from interface:OutputDigestCalculatorReturn the parameters for this digest calculator.- Specified by:
getParametersin interfaceOutputDigestCalculator<T>- Returns:
- the digest calculator's parameters.
-
getDigestSize
public abstract int getDigestSize()Description copied from interface:OutputDigestCalculatorReturn the size of the digest produced by this calculator in bytes.- Specified by:
getDigestSizein interfaceOutputDigestCalculator<T>- Returns:
- digest length in bytes.
-
getDigestBlockSize
public abstract int getDigestBlockSize()Description copied from interface:OutputDigestCalculatorReturn the size, in bytes, of the internal block used by the digest in this calculator.- Specified by:
getDigestBlockSizein interfaceOutputDigestCalculator<T>- Returns:
- internal block size in bytes.
-
getDigestStream
Description copied from interface:OutputDigestCalculatorReturns a stream that will accept data for the purpose of calculating a digest. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate the data on the fly as well.- Specified by:
getDigestStreamin interfaceOutputDigestCalculator<T>- Returns:
- an OutputStream
-
getDigest
public abstract int getDigest(byte[] output, int offSet) Description copied from interface:OutputDigestCalculatorOutput the current digest value for what has been written to the calculator's output stream.- Specified by:
getDigestin interfaceOutputDigestCalculator<T>- Parameters:
output- output array to write the digest to.offSet- offset to start writing the digest at..- Returns:
- the number of bytes written.
-
reset
public abstract void reset()Description copied from interface:OutputDigestCalculatorReset the calculator back to its initial state.- Specified by:
resetin interfaceOutputDigestCalculator<T>
-
clone
Description copied from interface:OutputDigestCalculatorReturn a clone of this calculator.- Specified by:
clonein interfaceOutputDigestCalculator<T>- Overrides:
clonein classObject- Returns:
- a clone of the digest calculator.
- Throws:
CloneNotSupportedException- if cloning is not possible.
-