Module hmac

Source
Available on crate feature unstable only.
Expand description

§Hash-based Message Authentication Code (HMAC) Accelerator

§Overview

HMAC is a secure authentication technique that verifies the authenticity and integrity of a message with a pre-shared key. This module provides hardware acceleration for SHA256-HMAC generation using a key burned into an eFuse block.

Main features:

  • Standard HMAC-SHA-256 algorithm.
  • Hash result only accessible by configurable hardware peripheral (in downstream mode).
  • Compatible to challenge-response authentication algorithm.
  • Generates required keys for the Digital Signature (DS) peripheral (in downstream mode).
  • Re-enables soft-disabled JTAG (in downstream mode).

§Configuration

The HMAC module can be used in two modes - in ”upstream” mode the HMAC message is supplied by the user and the calculation result is read back by the user. In ”downstream” mode the HMAC module is used as a Key Derivation Function (KDF) for other internal hardwares.

§HMAC padding

The HMAC padding is handled by the driver. In downstream mode, users do not need to input any message or apply padding. The HMAC module uses a default 32-byte pattern of 0x00 for re-enabling JTAG and a 32-byte pattern of 0xff for deriving the AES key for the DS module.

§Examples

Visit the HMAC example to learn how to use the HMAC accelerator

Structs§

Hmac
Provides an interface for interacting with the HMAC hardware peripheral. It allows users to compute HMACs for cryptographic purposes, ensuring data integrity and authenticity.

Enums§

Error
HMAC interface error
HmacPurpose
The peripheral can be configured to deliver its output directly to the user. It can also deliver to other peripherals.
KeyId
Represents the key identifiers for the HMAC peripheral.