Class TupleHash
- Namespace
- Org.BouncyCastle.Crypto.Digests
- Assembly
- BouncyCastle.Cryptography.dll
TupleHash - a hash designed to simply hash a tuple of input strings, any or all of which may be empty strings, in an unambiguous way with an optional XOF mode.
From NIST Special Publication 800-185 - SHA-3 Derived Functions:cSHAKE, KMAC, TupleHash and ParallelHash
public class TupleHash : IXof, IDigest
- Inheritance
-
TupleHash
- Implements
- Inherited Members
Constructors
TupleHash(TupleHash)
public TupleHash(TupleHash original)
Parameters
originalTupleHash
TupleHash(int, byte[])
public TupleHash(int bitLength, byte[] S)
Parameters
TupleHash(int, byte[], int)
public TupleHash(int bitLength, byte[] S, int outputSize)
Parameters
Properties
AlgorithmName
The algorithm name.
public virtual string AlgorithmName { get; }
Property Value
Methods
BlockUpdate(byte[], int, int)
Update the message digest with a block of bytes.
public virtual void BlockUpdate(byte[] inBuf, int inOff, int len)
Parameters
BlockUpdate(ReadOnlySpan<byte>)
Update the message digest with a span of bytes.
public virtual void BlockUpdate(ReadOnlySpan<byte> input)
Parameters
inputReadOnlySpan<byte>The span containing the data.
DoFinal(byte[], int)
Close the digest, producing the final digest value.
public virtual int DoFinal(byte[] outBuf, int outOff)
Parameters
Returns
- int
The number of bytes written.
Remarks
This call leaves the digest reset.
DoFinal(Span<byte>)
Close the digest, producing the final digest value.
public virtual int DoFinal(Span<byte> output)
Parameters
Returns
- int
The number of bytes written.
Remarks
This call leaves the digest reset.
GetByteLength()
Return the size, in bytes, of the internal buffer used by this digest.
public virtual int GetByteLength()
Returns
- int
The size, in bytes, of the internal buffer used by this digest.
GetDigestSize()
Return the size, in bytes, of the digest produced by this message digest.
public virtual 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[] outBuf, int outOff, int outLen)
Parameters
outBufbyte[]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[] outBuf, int outOff, int outLen)
Parameters
outBufbyte[]outOffintoffset to start writing the bytes at.
outLenintthe number of output bytes requested.
Returns
- int
the number of bytes written
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
Reset()
Reset the digest back to its initial state.
public virtual void Reset()
Update(byte)
Update the message digest with a single byte.
public virtual void Update(byte b)
Parameters
bbyte