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 int
getDigest
(byte[] output, int offSet) Output the current digest value for what has been written to the calculator's output stream.abstract int
Return the size, in bytes, of the internal block used by the digest in this calculator.abstract int
Return the size of the digest produced by this calculator in bytes.abstract UpdateOutputStream
Returns a stream that will accept data for the purpose of calculating a digest.abstract T
Return the parameters for this digest calculator.abstract void
reset()
Reset the calculator back to its initial state.
-
Method Details
-
getDigest
public final byte[] getDigest()Description copied from interface:OutputDigestCalculator
Return the digest calculated on what has been written to the calculator's output stream.- Specified by:
getDigest
in interfaceOutputDigestCalculator<T>
- Returns:
- a digest.
-
getParameters
Description copied from interface:OutputDigestCalculator
Return the parameters for this digest calculator.- Specified by:
getParameters
in interfaceOutputDigestCalculator<T>
- Returns:
- the digest calculator's parameters.
-
getDigestSize
public abstract int getDigestSize()Description copied from interface:OutputDigestCalculator
Return the size of the digest produced by this calculator in bytes.- Specified by:
getDigestSize
in interfaceOutputDigestCalculator<T>
- Returns:
- digest length in bytes.
-
getDigestBlockSize
public abstract int getDigestBlockSize()Description copied from interface:OutputDigestCalculator
Return the size, in bytes, of the internal block used by the digest in this calculator.- Specified by:
getDigestBlockSize
in interfaceOutputDigestCalculator<T>
- Returns:
- internal block size in bytes.
-
getDigestStream
Description copied from interface:OutputDigestCalculator
Returns 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:
getDigestStream
in interfaceOutputDigestCalculator<T>
- Returns:
- an OutputStream
-
getDigest
public abstract int getDigest(byte[] output, int offSet) Description copied from interface:OutputDigestCalculator
Output the current digest value for what has been written to the calculator's output stream.- Specified by:
getDigest
in 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:OutputDigestCalculator
Reset the calculator back to its initial state.- Specified by:
reset
in interfaceOutputDigestCalculator<T>
-
clone
Description copied from interface:OutputDigestCalculator
Return a clone of this calculator.- Specified by:
clone
in interfaceOutputDigestCalculator<T>
- Overrides:
clone
in classObject
- Returns:
- a clone of the digest calculator.
- Throws:
CloneNotSupportedException
- if cloning is not possible.
-