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]