Package org.bouncycastle.crypto.digests
Class SHAKEDigest
- java.lang.Object
-
- org.bouncycastle.crypto.digests.KeccakDigest
-
- org.bouncycastle.crypto.digests.SHAKEDigest
-
- All Implemented Interfaces:
Digest
,ExtendedDigest
,Xof
- Direct Known Subclasses:
CSHAKEDigest
public class SHAKEDigest extends KeccakDigest implements Xof
implementation of SHAKE based on following KeccakNISTInterface.c from https://keccak.noekeon.org/Following the naming conventions used in the C source code to enable easy review of the implementation.
-
-
Field Summary
-
Fields inherited from class org.bouncycastle.crypto.digests.KeccakDigest
bitsInQueue, dataQueue, fixedOutputLength, purpose, rate, squeezing, state
-
-
Constructor Summary
Constructors Constructor Description SHAKEDigest()
SHAKEDigest(int bitStrength)
Base constructor.SHAKEDigest(int bitStrength, CryptoServicePurpose purpose)
Base constructor.SHAKEDigest(CryptoServicePurpose purpose)
SHAKEDigest(SHAKEDigest source)
Clone constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CryptoServiceProperties
cryptoServiceProperties()
int
doFinal(byte[] out, int outOff)
close the digest, producing the final digest value.protected int
doFinal(byte[] out, int outOff, byte partialByte, int partialBits)
int
doFinal(byte[] out, int outOff, int outLen)
Output the results of the final calculation for this digest to outLen number of bytes.protected int
doFinal(byte[] out, int outOff, int outLen, byte partialByte, int partialBits)
int
doOutput(byte[] out, int outOff, int outLen)
Start outputting the results of the final calculation for this digest.java.lang.String
getAlgorithmName()
return the algorithm nameint
getDigestSize()
return the size, in bytes, of the digest produced by this message digest.-
Methods inherited from class org.bouncycastle.crypto.digests.KeccakDigest
absorb, absorb, absorbBits, getByteLength, reset, 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.ExtendedDigest
getByteLength
-
-
-
-
Constructor Detail
-
SHAKEDigest
public SHAKEDigest()
-
SHAKEDigest
public SHAKEDigest(CryptoServicePurpose purpose)
-
SHAKEDigest
public SHAKEDigest(int bitStrength)
Base constructor.- Parameters:
bitStrength
- the security strength in bits of the XOF.
-
SHAKEDigest
public SHAKEDigest(int bitStrength, CryptoServicePurpose purpose)
Base constructor.- Parameters:
bitStrength
- the security strength in bits of the XOF.purpose
- the purpose of the digest will be used for.
-
SHAKEDigest
public SHAKEDigest(SHAKEDigest source)
Clone constructor- Parameters:
source
- the other digest to be copied.
-
-
Method Detail
-
getAlgorithmName
public java.lang.String getAlgorithmName()
Description copied from interface:Digest
return the algorithm name- Specified by:
getAlgorithmName
in interfaceDigest
- Overrides:
getAlgorithmName
in classKeccakDigest
- Returns:
- the algorithm name
-
getDigestSize
public int getDigestSize()
Description copied from interface:Digest
return the size, in bytes, of the digest produced by this message digest.- Specified by:
getDigestSize
in interfaceDigest
- Overrides:
getDigestSize
in classKeccakDigest
- Returns:
- the size, in bytes, of the digest produced by this message digest.
-
doFinal
public int doFinal(byte[] out, int outOff)
Description copied from interface:Digest
close the digest, producing the final digest value. The doFinal call leaves the digest reset.- Specified by:
doFinal
in interfaceDigest
- Overrides:
doFinal
in classKeccakDigest
- Parameters:
out
- the array the digest is to be copied into.outOff
- the offset into the out array the digest is to start at.
-
doFinal
public int doFinal(byte[] out, int outOff, int outLen)
Description copied from interface:Xof
Output the results of the final calculation for this digest to outLen number of bytes.
-
doOutput
public int doOutput(byte[] out, int outOff, int outLen)
Description copied from interface:Xof
Start 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.
-
doFinal
protected int doFinal(byte[] out, int outOff, byte partialByte, int partialBits)
- Overrides:
doFinal
in classKeccakDigest
-
doFinal
protected int doFinal(byte[] out, int outOff, int outLen, byte partialByte, int partialBits)
-
cryptoServiceProperties
protected CryptoServiceProperties cryptoServiceProperties()
- Overrides:
cryptoServiceProperties
in classKeccakDigest
-
-