CryptoSys API Library Manual

Aead.Mac Method

Compute Message Authentication Code (tag) over input data

Syntax

[C#]
public static byte[] Mac(
	byte[] key,
	byte[] nonce,
	byte[] aad,
	Aead.Algorithm alg
)
[VB.NET]
Public Shared Function Mac ( _
	key As Byte(), _
	nonce As Byte(), _
	aad As Byte(), _
	alg As Aead.Algorithm _
) As Byte()

Parameters

key
Key of exact length for given algorithm (16 or 32 bytes).
nonce
Nonce of exact length for given algorithm (currently always 12 bytes)
aad
Data to be authenticated
alg
Type: Aead.Algorithm
AEAD algorithm to use

Return Value

Tag value in byte array, or empty array on error

Remarks

Use General.ErrorCode to find the code of the last error. This is equivalent to Aead.Encrypt with a zero-length plaintext input.

[Contents] [Index]

[PREV: Aead.Instance Method...]   [Contents]   [Index]   
   [NEXT: Aead.SetNonce Method...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.