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,ExtendedDigest,Xof
public class CSHAKEDigest extends SHAKEDigest
Customizable SHAKE function.
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.crypto.digests.KeccakDigest
bitsInQueue, dataQueue, fixedOutputLength, rate, squeezing, state
-
-
Constructor Summary
Constructors Constructor Description CSHAKEDigest(int bitLength, byte[] N, byte[] S)Base constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdoOutput(byte[] out, int outOff, int outLen)Start outputting the results of the final calculation for this digest.java.lang.StringgetAlgorithmName()return the algorithm namevoidreset()reset the digest back to it's initial state.-
Methods inherited from class org.bouncycastle.crypto.digests.SHAKEDigest
doFinal, doFinal, doFinal, doFinal
-
Methods inherited from class org.bouncycastle.crypto.digests.KeccakDigest
absorb, absorb, absorbBits, dumpState, getByteLength, getDigestSize, squeeze, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bouncycastle.crypto.Digest
getDigestSize, update, update
-
Methods inherited from interface org.bouncycastle.crypto.ExtendedDigest
getByteLength
-
-
-
-
Constructor Detail
-
CSHAKEDigest
public CSHAKEDigest(int bitLength, byte[] N, byte[] S)Base constructor.- Parameters:
bitLength- bit length 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.
-
-
Method Detail
-
getAlgorithmName
public java.lang.String 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
-
-