public class SHAKEDigest extends KeccakDigest implements SavableDigestXof
Following the naming conventions used in the C source code to enable easy review of the implementation.
bitsInQueue, dataQueue, fixedOutputLength, purpose, rate, squeezing, state
Constructor and Description |
---|
SHAKEDigest() |
SHAKEDigest(byte[] encoded) |
SHAKEDigest(byte[] encoded,
CryptoServicePurpose purpose) |
SHAKEDigest(CryptoServicePurpose purpose) |
SHAKEDigest(int bitStrength)
Base constructor.
|
SHAKEDigest(int bitStrength,
CryptoServicePurpose purpose)
Base constructor.
|
SHAKEDigest(SHAKEDigest source)
Clone constructor
|
Modifier and Type | Method and Description |
---|---|
Memoable |
copy()
Produce a copy of this object with its configuration and in its current state.
|
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 name
|
int |
getDigestSize()
return the size, in bytes, of the digest produced by this message digest.
|
byte[] |
getEncodedState()
Return an encoded byte array for the digest's internal state
|
static SavableDigestXof |
newInstance() |
static SavableDigestXof |
newInstance(byte[] encoded,
CryptoServicePurpose purpose) |
static SavableDigestXof |
newInstance(CryptoServicePurpose purpose) |
static SavableDigestXof |
newInstance(Digest digest) |
static SavableDigestXof |
newInstance(int bitStrength) |
static SavableDigestXof |
newInstance(int bitStrength,
CryptoServicePurpose purpose) |
void |
reset(Memoable other)
Restore a copied object state into this object.
|
java.lang.String |
toString() |
absorb, absorb, absorbBits, getByteLength, reset, squeeze, update, update
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getByteLength
public SHAKEDigest()
public SHAKEDigest(CryptoServicePurpose purpose)
public SHAKEDigest(int bitStrength)
bitStrength
- the security strength in bits of the XOF.public SHAKEDigest(int bitStrength, CryptoServicePurpose purpose)
bitStrength
- the security strength in bits of the XOF.purpose
- the purpose of the digest will be used for.public SHAKEDigest(SHAKEDigest source)
source
- the other digest to be copied.public SHAKEDigest(byte[] encoded)
public SHAKEDigest(byte[] encoded, CryptoServicePurpose purpose)
public static SavableDigestXof newInstance()
public static SavableDigestXof newInstance(CryptoServicePurpose purpose)
public static SavableDigestXof newInstance(int bitStrength)
public static SavableDigestXof newInstance(int bitStrength, CryptoServicePurpose purpose)
public static SavableDigestXof newInstance(byte[] encoded, CryptoServicePurpose purpose)
public static SavableDigestXof newInstance(Digest digest)
public java.lang.String getAlgorithmName()
Digest
getAlgorithmName
in interface Digest
getAlgorithmName
in class KeccakDigest
public int getDigestSize()
Digest
getDigestSize
in interface Digest
getDigestSize
in class KeccakDigest
public int doFinal(byte[] out, int outOff)
Digest
doFinal
in interface Digest
doFinal
in class KeccakDigest
out
- the array the digest is to be copied into.outOff
- the offset into the out array the digest is to start at.public int doFinal(byte[] out, int outOff, int outLen)
Xof
public int doOutput(byte[] out, int outOff, int outLen)
Xof
protected int doFinal(byte[] out, int outOff, byte partialByte, int partialBits)
doFinal
in class KeccakDigest
protected int doFinal(byte[] out, int outOff, int outLen, byte partialByte, int partialBits)
protected CryptoServiceProperties cryptoServiceProperties()
cryptoServiceProperties
in class KeccakDigest
public java.lang.String toString()
toString
in class java.lang.Object
public byte[] getEncodedState()
EncodableDigest
getEncodedState
in interface EncodableDigest
public Memoable copy()
Memoable
The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.