Table of Contents

Class Blake3Digest

Namespace
Org.BouncyCastle.Crypto.Digests
Assembly
BouncyCastle.Cryptography.dll
public sealed class Blake3Digest : IMemoable, IXof, IDigest
Inheritance
Blake3Digest
Implements
Inherited Members

Constructors

Blake3Digest()

public Blake3Digest()

Blake3Digest(Blake3Digest)

public Blake3Digest(Blake3Digest pSource)

Parameters

pSource Blake3Digest

Blake3Digest(int)

public Blake3Digest(int pDigestSize)

Parameters

pDigestSize int

the default digest size (in bits)

Properties

AlgorithmName

The algorithm name.

public string AlgorithmName { get; }

Property Value

string

Methods

BlockUpdate(byte[], int, int)

Update the message digest with a block of bytes.

public void BlockUpdate(byte[] pMessage, int pOffset, int pLen)

Parameters

pMessage byte[]
pOffset int
pLen int

BlockUpdate(ReadOnlySpan<byte>)

Update the message digest with a span of bytes.

public void BlockUpdate(ReadOnlySpan<byte> input)

Parameters

input ReadOnlySpan<byte>

The span containing the data.

Copy()

Produce a copy of this object with its configuration and in its current state.

public IMemoable Copy()

Returns

IMemoable

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 int DoFinal(byte[] pOutput, int pOutOffset)

Parameters

pOutput byte[]
pOutOffset int

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 int DoFinal(Span<byte> output)

Parameters

output Span<byte>

The span the digest is to be copied into.

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 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 int GetDigestSize()

Returns

int

The size, in bytes, of the digest produced by this message digest.

Init(Blake3Parameters)

public void Init(Blake3Parameters pParams)

Parameters

pParams Blake3Parameters

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 int Output(byte[] pOut, int pOutOffset, int pOutLen)

Parameters

pOut byte[]
pOutOffset int
pOutLen int

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 int Output(Span<byte> output)

Parameters

output Span<byte>

span to fill with the output bytes.

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 int OutputFinal(byte[] pOut, int pOutOffset, int pOutLen)

Parameters

pOut byte[]
pOutOffset int
pOutLen int

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 int OutputFinal(Span<byte> output)

Parameters

output Span<byte>

span to fill with the output bytes.

Returns

int

the number of bytes written

Reset()

Reset the digest back to its initial state.

public void Reset()

Reset(IMemoable)

Restore a copied object state into this object.

public void Reset(IMemoable pSource)

Parameters

pSource IMemoable

Remarks

Implementations of this method should try to avoid or minimise memory allocation to perform the reset.

Exceptions

InvalidCastException

if the provided object is not of the correct type.

MemoableResetException

if the other parameter is in some other way invalid.

Update(byte)

Update the message digest with a single byte.

public void Update(byte b)

Parameters

b byte