Class Blake2BConfig
Configuration for the Blake2 hash.
Inheritance
Inherited Members
Namespace: Isopoh.Cryptography.Blake2b
Assembly: Isopoh.Cryptography.Blake2b.dll
Syntax
public sealed class Blake2BConfig
Constructors
| Improve this Doc View SourceBlake2BConfig()
Initializes a new instance of the Blake2BConfig class.
Declaration
public Blake2BConfig()
Properties
| Improve this Doc View SourceKey
Gets or sets the key value used in the hash. If not null, must be 128 bytes or shorter.
Declaration
public byte[] Key { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Remarks
Blake2 keyed hashing can be used for authentication as a faster and simpler replacement for HMAC.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Attempt to set Key greater than 128 bytes. |
LockMemoryPolicy
Gets or sets the policy for created memory buffers.
Declaration
public LockMemoryPolicy LockMemoryPolicy { get; set; }
Property Value
Type | Description |
---|---|
LockMemoryPolicy |
OutputSizeInBits
Gets or sets the output size in bits. Must be a multiple of 8.
Declaration
public int OutputSizeInBits { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Attempt to set OutputSizeInBits to a value not a multiple of 8 bits. |
OutputSizeInBytes
Gets or sets the output size in bytes. Must be less than or equal to 64.
Declaration
public int OutputSizeInBytes { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
Blake2 incorporates this value into the hash. The array returned by the Isopoh.Cryptography.Blake2b.Blake2BHasher.Isopoh.Cryptography.Blake2b.Blake2BHasher.Finish call will be this length unless the Result64ByteBuffer value is non-null. If that property is non-null, that buffer gets returned by the Isopoh.Cryptography.Blake2b.Blake2BHasher.Isopoh.Cryptography.Blake2b.Blake2BHasher.Finish call regardless of the OutputSizeInBytes property. In that case, you can copy the first OutputSizeInBytes bytes of the Result64ByteBuffer array to get the value that Blake2 would have returned.
Personalization
Gets or sets the personalization value used in the hash. If not null, must be 16 bytes.
Declaration
public byte[] Personalization { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Attempt to set Personalization to non-null other than 16 bytes. |
Result64ByteBuffer
Gets or sets the 64-byte result buffer the Blake2 algorithm will use.
Declaration
public byte[] Result64ByteBuffer { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Remarks
If not null, this is the buffer that will get returned by the Isopoh.Cryptography.Blake2b.Blake2BHasher.Isopoh.Cryptography.Blake2b.Blake2BHasher.Finish call regardless of the value of OutputSizeInBytes.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Attempt to set Result64ByteBuffer to non-null other than 64 bytes. |
Salt
Gets or sets the salt value used in the hash. If not null, must be 16 bytes.
Declaration
public byte[] Salt { get; set; }
Property Value
Type | Description |
---|---|
System.Byte[] |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Attempt to set Salt to non-null other than 16 bytes. |