Package org.bouncycastle.crypto.digests
Class CSHAKEDigest
java.lang.Object
org.bouncycastle.crypto.digests.KeccakDigest
org.bouncycastle.crypto.digests.SHAKEDigest
org.bouncycastle.crypto.digests.CSHAKEDigest
- All Implemented Interfaces:
Digest,EncodableDigest,EncodableService,ExtendedDigest,SavableDigestXof,Xof,Memoable
Customizable SHAKE function.
-
Field Summary
Fields inherited from class org.bouncycastle.crypto.digests.KeccakDigest
bitsInQueue, dataQueue, fixedOutputLength, purpose, rate, squeezing, state -
Constructor Summary
ConstructorsConstructorDescriptionCSHAKEDigest(byte[] encodedState) CSHAKEDigest(int bitLength, byte[] N, byte[] S) Base constructor.CSHAKEDigest(int bitLength, CryptoServicePurpose purpose, byte[] N, byte[] S) Base constructor.CSHAKEDigest(CSHAKEDigest source) -
Method Summary
Modifier and TypeMethodDescriptioncopy()Produce a copy of this object with its configuration and in its current state.intdoOutput(byte[] out, int outOff, int outLen) Start outputting the results of the final calculation for this digest.return the algorithm namebyte[]Return an encoded byte array for the digest's internal statevoidreset()reset the digest back to it's initial state.voidRestore a copied object state into this object.Methods inherited from class org.bouncycastle.crypto.digests.SHAKEDigest
cryptoServiceProperties, doFinal, doFinal, doFinal, doFinal, getDigestSize, newInstance, newInstance, newInstance, newInstance, newInstance, newInstance, toStringMethods inherited from class org.bouncycastle.crypto.digests.KeccakDigest
absorb, absorb, absorbBits, copyIn, getByteLength, getEncodedState, squeeze, update, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bouncycastle.crypto.ExtendedDigest
getByteLength
-
Constructor Details
-
CSHAKEDigest
public CSHAKEDigest(int bitLength, byte[] N, byte[] S) Base constructor.- Parameters:
bitLength- security strength (in bits) of the underlying SHAKE function, 128 or 256.N- the function name string, note this is reserved for use by NIST. Avoid using it if not required.S- the customization string - available for local use.
-
CSHAKEDigest
Base constructor.- Parameters:
bitLength- security strength (in bits) of the underlying SHAKE function, 128 or 256.purpose- the purpose for constructing the CSHAKEDigestN- the function name string, note this is reserved for use by NIST. Avoid using it if not required.S- the customization string - available for local use.
-
CSHAKEDigest
-
CSHAKEDigest
public CSHAKEDigest(byte[] encodedState)
-
-
Method Details
-
getAlgorithmName
Description copied from interface:Digestreturn the algorithm name- Specified by:
getAlgorithmNamein interfaceDigest- Overrides:
getAlgorithmNamein classSHAKEDigest- Returns:
- the algorithm name
-
doOutput
public int doOutput(byte[] out, int outOff, int outLen) Description copied from interface:XofStart outputting the results of the final calculation for this digest. Unlike doFinal, this method will continue producing output until the Xof is explicitly reset, or signals otherwise.- Specified by:
doOutputin interfaceXof- Overrides:
doOutputin classSHAKEDigest- Parameters:
out- output array to write the output bytes to.outOff- offset to start writing the bytes at.outLen- the number of output bytes requested.- Returns:
- the number of bytes written
-
reset
public void reset()Description copied from interface:Digestreset the digest back to it's initial state.- Specified by:
resetin interfaceDigest- Overrides:
resetin classKeccakDigest
-
getEncodedState
public byte[] getEncodedState()Description copied from interface:EncodableDigestReturn an encoded byte array for the digest's internal state- Specified by:
getEncodedStatein interfaceEncodableDigest- Specified by:
getEncodedStatein interfaceEncodableService- Overrides:
getEncodedStatein classSHAKEDigest- Returns:
- an encoding of the digests internal state.
-
copy
Description copied from interface:MemoableProduce a copy of this object with its configuration and in its current state.The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.
- Specified by:
copyin interfaceMemoable- Overrides:
copyin classSHAKEDigest
-
reset
Description copied from interface:MemoableRestore a copied object state into this object.Implementations of this method should try to avoid or minimise memory allocation to perform the reset.
- Specified by:
resetin interfaceMemoable- Overrides:
resetin classSHAKEDigest- Parameters:
other- an object originallycopiedfrom an object of the same type as this instance.
-