Show / Hide Table of Contents

Class Blake2BConfig

Configuration for the Blake2 hash.

Inheritance
object
Blake2BConfig
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Isopoh.Cryptography.Blake2b
Assembly: Isopoh.Cryptography.Blake2b.dll
Syntax
public sealed class Blake2BConfig

Constructors

| Edit this page View Source

Blake2BConfig()

Initializes a new instance of the Blake2BConfig class.

Declaration
public Blake2BConfig()

Properties

| Edit this page View Source

Key

Gets or sets the key value used in the hash. If not null, must be 128 bytes or shorter.

Declaration
public Memory<byte>? Key { get; set; }
Property Value
Type Description
Memory<byte>?
Remarks

Blake2 keyed hashing can be used for authentication as a faster and simpler replacement for HMAC.

Exceptions
Type Condition
ArgumentException

Attempt to set Key greater than 128 bytes.

| Edit this page View Source

LockMemoryPolicy

Gets or sets the policy for created memory buffers.

Declaration
public LockMemoryPolicy LockMemoryPolicy { get; set; }
Property Value
Type Description
LockMemoryPolicy
| Edit this page View Source

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
int
Exceptions
Type Condition
ArgumentException

Attempt to set OutputSizeInBits to a value not a multiple of 8 bits.

| Edit this page View Source

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
int
Remarks

Blake2 incorporates this value into the hash. The array returned by the Blake2BHasher.Finish(Span<byte>) call will be this length unless the Result64ByteBuffer value is non-null. If that property is non-null, that buffer gets returned by the Blake2BHasher.Finish(Span<byte>) 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.

| Edit this page View Source

Personalization

Gets or sets the personalization value used in the hash. If not null, must be 16 bytes.

Declaration
public Memory<byte>? Personalization { get; set; }
Property Value
Type Description
Memory<byte>?
Exceptions
Type Condition
ArgumentException

Attempt to set Personalization to non-null other than 16 bytes.

| Edit this page View Source

Result64ByteBuffer

Gets or sets the 64-byte result buffer the Blake2 algorithm will use.

Declaration
public Memory<byte>? Result64ByteBuffer { get; set; }
Property Value
Type Description
Memory<byte>?
Remarks

If not null, this is the buffer that will get returned by the Blake2BHasher.Finish(Span<byte>) call regardless of the value of OutputSizeInBytes.

Exceptions
Type Condition
ArgumentException

Attempt to set Result64ByteBuffer to non-null other than 64 bytes.

| Edit this page View Source

Salt

Gets or sets the salt value used in the hash. If not null, must be 16 bytes.

Declaration
public Memory<byte>? Salt { get; set; }
Property Value
Type Description
Memory<byte>?
Exceptions
Type Condition
ArgumentException

Attempt to set Salt to non-null other than 16 bytes.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX