From NIST Special Publication 800-185 - SHA-3 Derived Functions:cSHAKE, KMAC, TupleHash and ParallelHash
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final CSHAKEDigest | |
| private boolean | |
| private boolean | |
| private byte[] | |
| private final int | |
| private static final byte[] |
| Access | Constructor and Description |
|---|---|
| public | KMAC(int
bit length of the underlying SHAKE function, 128 or 256. bitLength, byte[] the customization string - available for local use. S)Base constructor. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public int | doFinal(byte[]
the array the MAC is to be output to. out, int the offset into the out buffer the output is to start at. outOff)Implements org. Compute the final stage of the MAC writing the output to the out parameter. |
| public int | doFinal(byte[]
output array to write the output bytes to. out, int offset to start writing the bytes at. outOff, int the number of output bytes requested. outLen)Implements org. Output the results of the final calculation for this digest to outLen number of bytes. |
| public int | doOutput(byte[]
output array to write the output bytes to. out, int offset to start writing the bytes at. outOff, int the number of output bytes requested. outLen)Implements org. Start outputting the results of the final calculation for this digest. |
| private static byte[] | |
| public String | getAlgorithmName()
Implements org. Return the name of the algorithm the MAC implements. |
| public int | getByteLength()
Implements org. Return the size in bytes of the internal buffer the digest applies it's compression function to. |
| public int | getDigestSize()
Implements org. return the size, in bytes, of the digest produced by this message digest. |
| public int | getMacSize()
Implements org. Return the block size for this MAC (in bytes). |
| public void | init(CipherParameters
the key and other data required by the MAC. params)Implements org. Initialise the MAC. |
| public void | reset()
Implements org. Reset the MAC. |
| public void | update(byte
the byte to be processed. in)Implements org. add a single byte to the mac for processing. |
| public void | update(byte[]
the array containing the input. in, int the index in the array the data begins at. inOff, int the length of the input starting at inOff. len)Implements org. update the message digest with a block of bytes. |
| bitLength | back to summary |
|---|---|
| private final int bitLength | |
| cshake | back to summary |
|---|---|
| private final CSHAKEDigest cshake | |
| firstOutput | back to summary |
|---|---|
| private boolean firstOutput | |
| initialised | back to summary |
|---|---|
| private boolean initialised | |
| key | back to summary |
|---|---|
| private byte[] key | |
| outputLength | back to summary |
|---|---|
| private final int outputLength | |
| padding | back to summary |
|---|---|
| private static final byte[] padding | |
| KMAC | back to summary |
|---|---|
| public KMAC(int bitLength, byte[] S) Base constructor.
| |
| bytePad | back to summary |
|---|---|
| private void bytePad(byte[] X, int w) | |
| doFinal | back to summary |
|---|---|
| public int doFinal(byte[] out, int outOff) throws DataLengthException, IllegalStateException Implements org. Doc from org. Compute the final stage of the MAC writing the output to the out parameter. doFinal leaves the MAC in the same state it was after the last init.
| |
| doFinal | back to summary |
|---|---|
| public int doFinal(byte[] out, int outOff, int outLen) Implements org. Doc from org. Output the results of the final calculation for this digest to outLen number of bytes.
| |
| doOutput | back to summary |
|---|---|
| public int doOutput(byte[] out, int outOff, int outLen) Implements org. Doc from org. 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.
| |
| encode | back to summary |
|---|---|
| private static byte[] encode(byte[] X) | |
| getAlgorithmName | back to summary |
|---|---|
| public String getAlgorithmName() Implements org. Doc from org. Return the name of the algorithm the MAC implements.
| |
| getByteLength | back to summary |
|---|---|
| public int getByteLength() Implements org. Doc from org. Return the size in bytes of the internal buffer the digest applies it's compression function to.
| |
| getDigestSize | back to summary |
|---|---|
| public int getDigestSize() Implements org. Doc from org. return the size, in bytes, of the digest produced by this message digest.
| |
| getMacSize | back to summary |
|---|---|
| public int getMacSize() Implements org. Doc from org. Return the block size for this MAC (in bytes).
| |
| init | back to summary |
|---|---|
| public void init(CipherParameters params) throws IllegalArgumentException Implements org. Doc from org. Initialise the MAC.
| |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Doc from org. Reset the MAC. At the end of resetting the MAC should be in the in the same state it was after the last init (if there was one). | |
| update | back to summary |
|---|---|
| public void update(byte in) throws IllegalStateException Implements org. Doc from org. add a single byte to the mac for processing.
| |
| update | back to summary |
|---|---|
| public void update(byte[] in, int inOff, int len) throws DataLengthException, IllegalStateException Implements org. Doc from org. update the message digest with a block of bytes.
| |