<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.0" />

Blake2bDigest

public sealed class Blake2bDigest : IDigest
Implementation of the cryptographic hash function Blake2b. BLAKE2b is optimized for 64-bit platforms and produces digests of any size between 1 and 64 bytes.
public string AlgorithmName { get; }

public Blake2bDigest()

Initializes a new instance of Blake2bDigest.

Constructs a new instance of Blake2bDigest from another Blake2bDigest./>.

public Blake2bDigest(int digestSize)

Initializes a new instance of Blake2bDigest with a given digest size.

public Blake2bDigest(byte[] key)

Initializes a new instance of Blake2bDigest with a key.

Blake2b for authentication ("Prefix-MAC mode"). After calling the DoFinal method, the key will remain to be used for further computations of this instance. The key can be cleared using the ClearKey method.

public Blake2bDigest(byte[] key, int digestLength, byte[] salt, byte[] personalization)

Initializes a new instance of Blake2bDigest with a key, required digest length (in bytes), salt and personalization.

After calling the DoFinal method, the key, the salt and the personalization will remain and might be used for further computations with this instance. The key can be overwritten using the ClearKey method, the salt (pepper) can be overwritten using the ClearSalt method.

public void BlockUpdate(byte[] message, int offset, int len)

public void BlockUpdate(ReadOnlySpan<byte> input)

public void ClearKey()

Clears the key.

public void ClearSalt()

Clears the salt (pepper).

public int DoFinal(byte[] output, int outOffset)

Close the digest, producing the final digest value.

public int DoFinal(Span<byte> output)

Close the digest, producing the final digest value.

public int GetByteLength()

Return the size in bytes of the internal buffer the digest applies it's compression function to.

public int GetDigestSize()

public void Reset()

Reset the digest back to it's initial state. The key, the salt and the personalization will remain for further computations.

public void Update(byte b)