Class ShakeDigest
- Namespace
- Org.BouncyCastle.Crypto.Digests
- Assembly
- BouncyCastle.Cryptography.dll
Implementation of SHAKE based on following KeccakNISTInterface.c from http://keccak.noekeon.org/
public class ShakeDigest : KeccakDigest, IMemoable, IXof, IDigest
- Inheritance
-
ShakeDigest
- Implements
- Derived
- Inherited Members
Remarks
Following the naming conventions used in the C source code to enable easy review of the implementation.
Constructors
ShakeDigest()
public ShakeDigest()
ShakeDigest(ShakeDigest)
public ShakeDigest(ShakeDigest source)
Parameters
sourceShakeDigest
ShakeDigest(int)
public ShakeDigest(int bitLength)
Parameters
bitLengthint
Properties
AlgorithmName
The algorithm name.
public override string AlgorithmName { get; }
Property Value
Methods
Copy()
Produce a copy of this object with its configuration and in its current state.
public override IMemoable Copy()
Returns
Remarks
The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.
DoFinal(byte[], int)
Close the digest, producing the final digest value.
public override int DoFinal(byte[] output, int outOff)
Parameters
outputbyte[]The byte array the digest is to be copied into.
outOffintThe offset into the byte array the digest is to start at.
Returns
- int
The number of bytes written.
Remarks
This call leaves the digest reset.
DoFinal(byte[], int, byte, int)
protected override int DoFinal(byte[] output, int outOff, byte partialByte, int partialBits)
Parameters
Returns
DoFinal(Span<byte>)
Close the digest, producing the final digest value.
public override int DoFinal(Span<byte> output)
Parameters
Returns
- int
The number of bytes written.
Remarks
This call leaves the digest reset.
GetDigestSize()
Return the size, in bytes, of the digest produced by this message digest.
public override int GetDigestSize()
Returns
- int
The size, in bytes, of the digest produced by this message digest.
Output(byte[], int, int)
Start outputting the results of the final calculation for this XOF. Unlike DoFinal, this method will continue producing output until the XOF is explicitly reset, or signals otherwise.
public virtual int Output(byte[] output, int outOff, int outLen)
Parameters
outputbyte[]output array to write the output bytes to.
outOffintoffset to start writing the bytes at.
outLenintthe number of output bytes requested.
Returns
- int
the number of bytes written
Output(Span<byte>)
Start outputting the results of the final calculation for this XOF. Unlike OutputFinal, this method will continue producing output until the XOF is explicitly reset, or signals otherwise.
public virtual int Output(Span<byte> output)
Parameters
Returns
- int
the number of bytes written
OutputFinal(byte[], int, int)
Output the results of the final calculation for this XOF to outLen number of bytes.
public virtual int OutputFinal(byte[] output, int outOff, int outLen)
Parameters
outputbyte[]output array to write the output bytes to.
outOffintoffset to start writing the bytes at.
outLenintthe number of output bytes requested.
Returns
- int
the number of bytes written
OutputFinal(byte[], int, int, byte, int)
protected virtual int OutputFinal(byte[] output, int outOff, int outLen, byte partialByte, int partialBits)
Parameters
Returns
OutputFinal(Span<byte>)
Output the results of the final calculation for this XOF to fill the output span.
public virtual int OutputFinal(Span<byte> output)
Parameters
Returns
- int
the number of bytes written