HMAC Verify
This MotoHawk™ block is part of the Cryptography Blockset and allows to verify an HMAC (Hash-based Message Authentication Code) signature.
Block ID
HMAC Verify
Library
motohawk_crypto_lib
Description

This MotoHawk™ block is part of the Cryptography Blockset and allows to verify an HMAC (Hash-based Message Authentication Code) signature. The signature is verified against the provided data using a reference to a defined key (Crypto Key Definition) and the selected hashing algorithm.
For the verification to be valid, the provided data, key value, and hash algorithm must match those used to generate (HMAC Sign) the signature.
Input Ports
Plain[N] (uint8)
An array of data based on which the HMAC signature is to be verified. The length (N) of the array must match the value passed in the 'Length' port.
Length (uint32)
The length of the data array passed to the 'Plain' port. By default, there is no limit on the length of the data used to the HMAC related operations.
HMAC[L] (uint8)
An array containing the verified HMAC value. The expected length (L) of the signature depends on the selected hashing algorithm.
| Hash algorithm | HMAC expected length (bytes) |
|---|---|
| SHA_1 | 20 |
| SHA2_224 | 28 |
| SHA2_256 | 32 |
| SHA2_384 | 48 |
| SHA2_512 | 64 |
| SHA2_512_224 | 28 |
| SHA2_512_256 | 32 |
| SHA3_224 | 28 |
| SHA3_256 | 32 |
| SHA3_384 | 48 |
| SHA3_512 | 64 |
Output Ports
Status (boolean)
Indicates whether the signature verification process was successful: true if the HMAC was verified successfully; otherwise false.
Failure may occur for several reasons:
- the value of the referenced key has not been defined,
- the provided data length does not match the actual size,
- the input data used to verify the signature differs from that used for generation, e.g., the data, the key value, the type of hashing algorithm,
- other, specific limitations of the cryptographic engine used in the selected module.
Block Parameters
| Parameter Field | Values | Comments/Description |
|---|---|---|
| Reference Key Name | Single quote enclosed c-legal alpha-numeric text |
The name of the associated Crypto Key Definition of the 'HMAC' type. |
| Hash Algorithm | Dropdown |
The hashing algorithm used to verify the HMAC signature. |
