Class KeccakDigest

java.lang.Object
org.bouncycastle.pqc.crypto.mldsa.KeccakDigest

public class KeccakDigest extends Object
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 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

      public KeccakDigest(KeccakDigest source)
  • Method Details

    • getAlgorithmName

      public String 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)