Class KeccakDigest
java.lang.Object
org.bouncycastle.pqc.crypto.mldsa.KeccakDigest
implementation of Keccak 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
FieldsModifier and TypeFieldDescriptionprotected intprotected byte[]protected intprotected intprotected booleanprotected long[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidabsorb(byte data) protected voidabsorb(byte[] data, int off, int len) protected voidabsorbBits(int data, int bits) intdoFinal(byte[] out, int outOff) protected intdoFinal(byte[] out, int outOff, byte partialByte, int partialBits) intReturn the size of block that the compression function is applied to in bytes.intvoidreset()protected voidsqueeze(byte[] output, int offset, long outputLength) voidupdate(byte in) voidupdate(byte[] in, int inOff, int len)
-
Field Details
-
state
protected long[] state -
dataQueue
protected byte[] dataQueue -
rate
protected int rate -
bitsInQueue
protected int bitsInQueue -
fixedOutputLength
protected int fixedOutputLength -
squeezing
protected boolean squeezing
-
-
Constructor Details
-
KeccakDigest
public KeccakDigest() -
KeccakDigest
public KeccakDigest(int bitLength) -
KeccakDigest
-
-
Method Details
-
getAlgorithmName
-
getDigestSize
public int getDigestSize() -
update
public void update(byte in) -
update
public void update(byte[] in, int inOff, int len) -
doFinal
public int doFinal(byte[] out, int outOff) -
doFinal
protected int doFinal(byte[] out, int outOff, byte partialByte, int partialBits) -
reset
public void reset() -
getByteLength
public int getByteLength()Return the size of block that the compression function is applied to in bytes.- Returns:
- internal byte length of a block.
-
absorb
protected void absorb(byte data) -
absorb
protected void absorb(byte[] data, int off, int len) -
absorbBits
protected void absorbBits(int data, int bits) -
squeeze
protected void squeeze(byte[] output, int offset, long outputLength)
-