Table of Contents

Class HmacSha512

Namespace
CryptoHives.Foundation.Security.Cryptography.Mac
Assembly
CryptoHives.Foundation.Security.Cryptography.dll

Computes the HMAC-SHA-512 message authentication code.

public sealed class HmacSha512 : HmacCore, IMac, IDisposable
Inheritance
HmacSha512
Implements
Inherited Members

Remarks

This is a fully managed implementation of HMAC-SHA-512 as defined in RFC 2104, using the CryptoHives SHA-512 implementation. It does not rely on OS or hardware cryptographic APIs, ensuring deterministic behavior across all platforms.

HMAC-SHA-512 produces a 512-bit (64-byte) authentication tag.

Constructors

HmacSha512(byte[])

Initializes a new instance of the HmacSha512 class.

public HmacSha512(byte[] key)

Parameters

key byte[]

The secret key.

Fields

MacSizeBits

The MAC output size in bits.

public const int MacSizeBits = 512

Field Value

int

MacSizeBytes

The MAC output size in bytes.

public const int MacSizeBytes = 64

Field Value

int

Methods

Create(byte[])

Creates a new instance of the HmacSha512 class.

public static HmacSha512 Create(byte[] key)

Parameters

key byte[]

The secret key.

Returns

HmacSha512

A new HMAC-SHA-512 instance.

Hash(byte[], byte[])

Computes the HMAC-SHA-512 tag for the specified key and data in a single operation.

public static byte[] Hash(byte[] key, byte[] data)

Parameters

key byte[]

The secret key.

data byte[]

The data to authenticate.

Returns

byte[]

The 64-byte MAC tag.