Show / Hide Table of Contents

Class Blake2BCore

The core of the Blake2 hash.

Inheritance
System.Object
Blake2BCore
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Isopoh.Cryptography.Blake2b
Assembly: Isopoh.Cryptography.Blake2b.dll
Syntax
public sealed class Blake2BCore : IDisposable

Constructors

| Improve this Doc View Source

Blake2BCore(SecureArrayCall, LockMemoryPolicy)

Initializes a new instance of the Blake2BCore class.

Declaration
public Blake2BCore(SecureArrayCall secureArrayCall, LockMemoryPolicy lockMemory = LockMemoryPolicy.BestEffort)
Parameters
Type Name Description
SecureArrayCall secureArrayCall

The methods that get called to secure arrays. A null value defaults to SecureArray.DefaultCall.

LockMemoryPolicy lockMemory

Used to set locking strategy for buffers used in creating the hash. The memory will always be zeroed prior to destruction. The memory is also always pinned so the CLR can't move it and leave extraneous copies floating around in RAM.

Methods

| Improve this Doc View Source

BytesToUInt64(Byte[], Int32)

Convert a big-endian buffer into a System.UInt64.

Declaration
public static ulong BytesToUInt64(byte[] buf, int offset)
Parameters
Type Name Description
System.Byte[] buf

Buffer holding an 8-byte big-endian ulong.

System.Int32 offset

Offset into the buffer to start reading the ulong.

Returns
Type Description
System.UInt64

The parsed ulong.

Remarks

No checking is done to verify that an 8-byte value can be read from buf at offset.

| Improve this Doc View Source

Dispose()

Release unmanaged resources.

Declaration
public void Dispose()
| Improve this Doc View Source

HashCore(Byte[], Int32, Int32)

Update the hash state.

Declaration
public void HashCore(byte[] array, int start, int count)
Parameters
Type Name Description
System.Byte[] array

Data to use to update the hash state.

System.Int32 start

Index of the first byte in array to use.

System.Int32 count

Number of bytes in array to use.

| Improve this Doc View Source

HashFinal()

Return the hash.

Declaration
public byte[] HashFinal()
Returns
Type Description
System.Byte[]

The 64-byte hash.

| Improve this Doc View Source

HashFinal(Boolean)

Return the hash.

Declaration
public byte[] HashFinal(bool isEndOfLayer)
Parameters
Type Name Description
System.Boolean isEndOfLayer

True to signal the last node of a layer in tree-hashing mode; false otherwise.

Returns
Type Description
System.Byte[]

The 64-byte hash.

| Improve this Doc View Source

HashFinal(Byte[])

Compute the hash.

Declaration
public byte[] HashFinal(byte[] hash)
Parameters
Type Name Description
System.Byte[] hash

Loaded with the hash.

Returns
Type Description
System.Byte[]

hash.

| Improve this Doc View Source

HashFinal(Byte[], Boolean)

Compute the hash.

Declaration
public byte[] HashFinal(byte[] hash, bool isEndOfLayer)
Parameters
Type Name Description
System.Byte[] hash

Loaded with the hash.

System.Boolean isEndOfLayer

True to signal the last node of a layer in tree-hashing mode; false otherwise.

Returns
Type Description
System.Byte[]

hash.

| Improve this Doc View Source

Initialize(UInt64[])

Initialize the hash.

Declaration
public void Initialize(ulong[] config)
Parameters
Type Name Description
System.UInt64[] config

8-element configuration array.

| Improve this Doc View Source

UInt64ToBytes(UInt64, Byte[], Int32)

Store a ulong into a byte buffer as big-endian.

Declaration
public static void UInt64ToBytes(ulong value, byte[] buf, int offset)
Parameters
Type Name Description
System.UInt64 value

The ulong to store.

System.Byte[] buf

The buffer to load the 8-byte value into.

System.Int32 offset

The offset to start value at in buf.

Remarks

No checking is done to validate the buffer can store value at offset.

Implements

System.IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX