embassy-nrf

Crates

git

Versions

nrf9151-s

Flavors

Skip to main content

Module crypto

Module crypto 

Source
Expand description

Cryptographic accelerator: CryptoCell (nRF52840, nRF5340, nRF91) or CRACEN (nRF54L).

The accelerator has three independent engines, each owned through its own peripheral:

  • The symmetric engines (AES, hash, ChaCha20). They share one DMA, so only one of them runs at a time. Owned through CRYPTO_SYMMETRIC and the symmetric::Symmetric driver.
  • The public key accelerator. Owned through CRYPTO_PKA and the pka::Pka driver.
  • The true random number generator. Owned through CRYPTO_RNG and the rng::Rng driver.

The accelerator is powered while any of these drivers exists. It is powered down when the last one is dropped.

§embassy-crypto

The embassy-crypto-* features register the accelerator as embassy-crypto drivers.

Each of these features takes over the corresponding peripheral, and its singleton disappears from Peripherals. For each engine you have to choose between the direct API in this module and embassy-crypto. You cannot use both.

Modules§

pka
Public key accelerator.
rng
True random number generator of the cryptographic accelerator.
symmetric
Symmetric crypto engines: AES, hash and ChaCha.