Blake2b256 Class
Namespace: Rebex.Security.Cryptography
Assembly: Rebex.Security.dll (version 7.0.9147)
This class represents the BLAKE2b cryptographic hash and message authentication code (MAC) algorithm with hash size of 256 bits (32 bytes).
Syntax
public sealed class Blake2b256 : Blake2b, ICryptoTransform, IDisposable
Inherited Members
Remarks
The 256-bit (32-byte) BLAKE2b hash value can be computed using an instance of this class that offers methods
declared by .NET Keyed
Examples
// sourceData argument contains data to be hashed.
public byte[] Calculate256BitsHash(byte[] sourceData)
{
// create an instance of Blake2b256 class
using (var blake2b256 = new Blake2b256())
{
// compute and return the 256-bit (32-byte) hash
return blake2b256.ComputeHash(sourceData);
} // blake2b256 instance is disposed
}
Constructors
Name | Description |
---|---|
Blake2b256() | Initializes a new instance of the Blake2b256 class. |
Blake2b256(Byte[]) | Initializes a new instance of the Blake2b class. |
Properties
Name | Description |
---|---|
Can |
Gets a value indicating whether the current transform can be reused. Inherited from Blake2b. |
Can |
Gets the value indicating whether the instance can transform multiple blocks. Inherited from Blake2b. |
Hash |
Gets the size of the hash in bits. Inherited from Blake2b. |
Key | Key to use in HMAC calculations. The key must be a 0 - 64 bytes long array or null. When a null value is provided, the key is treated as an empty array. When the key is null or an empty array, the instance will calculate hashes. When the key is 1 - 64 bytes long, the instance will calculate message authentication codes (HMAC). An instance of the Blake2b class creates, uses, and clears a copy of key. An instance of the Blake2b class is not the owner of the key. Every call of the get accessor returns a new deep copy of the key. and the key will not be cleared when the Dispose(Boolean) method is called. Inherited from Blake2b. |
Methods
Name | Description |
---|---|
Dispose(Boolean) | Releases the resources used by this instance of the Blake2b class. Inherited from Blake2b. |
Hash |
Hashes the specified segment of the specified |
HashCore(ReadOnlySpan<Byte>) | Hashes the specified |
HashData(ArraySegment<Byte>, ArraySegment<Byte>) | Computes a 256-bit (32-byte) hash using the BLAKE2b cryptographic hash and message authentication code (MAC) algorithm. |
HashData(ArraySegment<Byte>, ArraySegment<Byte>, ArraySegment<Byte>) | Computes a 256-bit (32-byte) hash using the BLAKE2b cryptographic hash and message authentication code (MAC) algorithm. |
Hash |
Computes a 256-bit (32-byte) hash using the BLAKE2b cryptographic hash and message authentication code (MAC) algorithm. |
Hash |
Finishes hash computation. Inherited from Blake2b. |
Initialize() | Resets the instance to its initial state. Discards all data from the previous or current hash computation. Inherited from Blake2b. |
TryHashFinal(Span<Byte>, out Int32) | Finishes hash computation. Inherited from Blake2b. |