CRYPTOCELL — Arm TrustZone CryptoCell 312

Arm® TrustZone® CryptoCell 312 (CRYPTOCELL) is a security subsystem providing root of trust (RoT) and cryptographic services for a device.

Figure 1. CRYPTOCELL block diagram
CRYPTOCELL block diagram

The following cryptographic features are among the functionality that can be supported:

  • True random number generator (TRNG) compliant with FIPS 140-2, BSI AIS-31, and NIST 800-90B.
  • Pseudorandom number generator (PRNG) using underlying AES engine compliant with NIST 800-90A
  • RSA public key cryptography
    • Signature verification up to key sizes of 4096 bits
    • Key generation up to key sizes of 3072 bits
    • PKCS#1 v2.1/v1.5
  • Elliptic curve cryptography (ECC)
    • NIST FIPS 186-4 recommended curves using pseudorandom parameters, up to 521 bits:
      • Prime field: P-192, P-224, P-256, P-384, P-521
    • SEC 2 recommended curves using pseudorandom parameters, up to 521 bits:
      • Prime field: secp160r1, secp192r1, secp224r1, secp256r1, secp384r1, secp521r1
    • Koblitz curves using fixed parameters, up to 256 bits:
      • Prime field: secp160k1, secp192k1, secp224k1, secp256k1
    • Brainpool curves:
      • Prime field: BrainpoolP256r1
    • Edwards/Montgomery curves:
      • Ed25519, Curve25519
    • ECDH/ECDSA support
  • Secure remote password protocol (SRP), up to 3072 bits operations
  • Hashing functions
    • SHA-1, SHA-2 up to 256 bits
    • Keyed-hash message authentication code (HMAC)
  • AES symmetric encryption
    • General purpose AES engine (encrypt/decrypt, sign/verify)
    • 128, 192, and 256 bits key size
    • Supported encryption modes: ECB, CBC, CMAC/CBC-MAC, CTR, CCM/CCM*, GCM
  • ChaCha20/Poly1305 symmetric encryption
    • 128 and 256 bits key size
    • Authenticated encryption with associated data (AEAD) mode

Disclaimer

This section contains an important disclaimer about the CRYPTOCELL subsystem documentation.

The CRYPTOCELL subsystem is recommended for use with the libraries in the Nordic Semiconductor ASA SDK. These libraries are tested and verified to work with the CRYPTOCELL subsystem hardware. The CRYPTOCELL subsystem documentation and register descriptions are for reference only and can be used for modifying the Nordic supplied SDK libraries or implementing new features.

Nordic Semiconductor ASA reserves the right to change the CRYPTOCELL documentation and register descriptions without further notice. Changes will not trigger erratas and will not be seen as changing form/fit/function of the device.

Please note that Nordic cannot support questions directly related to the register interface or modification of the source code implementation. Nordic provide support for the top-level API in the software library distributed as part of the device SDK.

Usage

The CRYPTOCELL subsystem is a hardware and software solution where software is delivered as libraries in Nordic device SDKs. Recommended usage of the CRYPTOCELL subsystem is to use the SDK library implementation available for the device. The CRYPTOCELL subsystem is documented for reference purpose only, please see section Disclaimer for more information.

To enable CRYPTOCELL, use register ENABLE. The device will not enter the System ON IDLE mode until CRYPTOCELL has been disabled, see POWER — Power control for more information. The Nordic SDK software library automatically controls enabling and disabling of the CRYPTOCELL subsystem as a part of its function calls.

Security configuration

CRYPTOCELL has internal storage for its security configuration, which is preserved even if CRYPTOCELL is disabled.

The following configuration settings are retained:
  • Device life cycle state (LCS)
  • Various lock bits
  • APB filtering configuration

Any reset source will erase the CRYPTOCELL internal storage, see RESET — Reset control for more information.

APB filtering

Access permissions for the CRYPTOCELL subsystem APB slave interface can be controlled and locked until the next power-on reset through a register.

For more details, see register AO_APB_FILTERING. The configuration will be stored in the CRYPTOCELL subsystem internal storage until next power-on reset.

Cryptographic flow

The following section describe a typical cryptographic flow for the CRYPTOCELL subsystem.

  1. Enable CRYPTOCELL subsystem as described in Usage.
  2. Perform clock control for the desired cryptographic engine(s) as described in Power and clock.
  3. Configure the desired cryptographic mode as described in CTL interface.
  4. Depending on the selected cryptographic mode the active engine(s) must be configured, including which cryptographic key to use as described in Cryptographic key selection.
  5. Optionally configure DMA engines as described in Direct memory access (DMA).
  6. Initiate the operation, and wait for an event as described in Interrupt handling.
  7. Check status register(s) for the active engine(s).

Cryptographic key selection

The CRYPTOCELL subsystem can operate on different cryptographic keys.

Session keys

Session keys are supported by the AES, GHASH, and CHACHA engine.

Before starting a cryptographic operation using a session key, the desired key value must be written in clear-text by the CPU into the write-only key registers of the corresponding engine. One session key can be overwritten by another as long as the write order of the write-only key registers are respected. Please refer to the corresponding chapter of each cryptographic engine for more information about write order.

The AES engine supports 128/192/256 bits session keys, GHASH engine supports 128 bits session keys, and CHACHA engine supports 128/256 bits session keys.

The last written session key for each engine is retained until CRYPTOCELL is disabled, the engine is reset, or the device is reset.

Key Management Unit (KMU) keys

The KMU — Key management unit is designed to securely transfer symmetric encryption keys directly into the dedicated write-only key registers of the AES and CHACHA cryptographic engines upon request from the CPU.

Pushing a symmetric key value stored in a KMU key slot into either the AES or CHACHA engine will replace the need for software to write a session key in clear-text into registers AES_KEY_0[n] (n=0..7) and AES_KEY_1[n] (n=0..7) for 128/256 bits AES keys or registers CHACHA_KEY[n] (n=0..7) for 128/256 bits CHACHA keys.

The symmetric key value pushed from a KMU key slot into the AES or CHACHA engine will be retained until CRYPTOCELL is disabled or the device is reset.

Asymmetric keys

Asymmetric cryptographic keys are supported by the PKA engine.

Before starting a cryptographic operation using an asymmetric key, the desired key value must be written into the PKA SRAM together with the payload.

See PKA engine for more information.

Internal memories

CRYPTOCELL contains two dedicated memory blocks; one 6 kB SRAM block for the PKA engine calculations, and one 2 kB SRAM block for the RNG engine entropy collector.

See PKA SRAM and RNG SRAM for more information about these dedicated memory blocks.

Direct memory access (DMA)

CRYPTOCELL support direct memory access (DMA) to allow cryptographic operations on memory mapped regions without involving the CPU.

The following table indicates which memory is accessible by CRYPTOCELL DMA engines.

Table 1. DMA transaction types
Memory typeReadWrite
SRAMYesYes
FlashYesYes

Data stored in a memory type not accessible by CRYPTOCELL DMA engines must be copied to an accessible memory type before it can be processed by the CRYPTOCELL subsystem. Maximum DMA transaction size is limited to 216-1 bytes.

The CRYPTOCELL DMA engine can also run in Bypass mode, meaning data is read and written without being piped through a cryptographic engine. Thus CRYPTOCELL can act as a general purpose DMA engine for moving data.

Operating the DMA engines in Bypass mode involve the following steps:
  1. Enable DMA engines clock using register DMA_CLK.
  2. Configure cryptographic control for Bypass mode using register CRYPTO_CTL.
  3. Set the the output destination address and size of the receiving buffer.
  4. Start the DMA transaction by configuring the input source address and the number of bytes to transfer.
  5. Status of the DMA transaction can be monitored by either polling register DOUT_DMA_MEM_BUSY, or by unmasking the interrupt for field DOUT_TO_MEM_MASK in register IMR.

See DIN DMA engine and DOUT DMA engine for more information.

Power and clock

Power and clock management of the CRYPTOCELL subsystem is handled automatically in hardware, as long as the neccessary conditions are fulfilled by software.

Clock gating

CRYPTOCELL implements separate clock domains for each cryptographic engine. Internal clock gating control is handled through the MISC interface, as well as register RNG_CLK. The registers of a cryptographic engine are only accessible when its clock is enabled.

Power gating

CRYPTOCELL must be disabled to ensure lowest possible power consumption when the subsystem is not needed.

The CRYPTOCELL subsystem power is controlled through register ENABLE. Even though external clock input is gated away automatically by hardware, the CRYPTOCELL subsystem power will still be enabled. To initiate a full power-down sequence software must perform the following steps:
  1. Make sure there are no pending tasks
  2. Verify that CRYPTOCELL subsystem is idle using register HOST_CC_IS_IDLE.
  3. Clear all pending interrupts in register RNG_ICR and register ICR.
  4. Request power-down by writing to register HOST_POWERDOWN.
  5. Disable CRYPTOCELL subsystem using register ENABLE.

If the power-down request in step 4 has been issued, the CRYPTOCELL subsystem must be disabled, as outlined in step 5.

Interrupt handling

CRYPTOCELL triggers interrupt once processing is complete.

See register IRR for more information on which CRYPTOCELL subsystem components are able to trigger an interrupt request.

To clear the IRQ line when an interrupt has occurred, the relevant interrupt bit in register ICR must be cleared. Interrupt sources can be masked using register IMR. If an interrupt source is masked, no interrupt request will be triggered.

In addition if field RNG_INT in register IRR is asserted, the relevant RNG engine interrupt bit in register RNG_ICR must be cleared before clearing that interrupt bit in register ICR as described above.

The figure below shows how the CRYPTOCELL subsystem interrupt handling is designed and how it is connected to the NVIC module in the CPU.

Figure 2. CRYPTOCELL interrupt handling

Standards

Arm TrustZone® CryptoCell 312 (CRYPTOCELL) is compliant with the protocol specifications and standards shown in the following table.

Table 2. CRYPTOCELL cryptography standards
Algorithm familyIdentification codeDocument title
TRNGNIST SP 800-90BRecommendation for the Entropy Sources Used for Random Bit Generation
BSI AIS-31Functionality Classes and Evaluation Methodology for True Random Number Generators
FIPS 140-2Security Requirements for Cryptographic Modules
PRNGNIST SP 800-90ARecommendation for Random Number Generation Using Deterministic Random Bit Generators
Stream cipherChachaChaCha, a variant of Salsa20, Daniel J. Bernstein, January 28th 2008
MACPoly1305

The Poly1305-AES message-authentication code, Daniel J. Bernstein

Cryptography in NaCl, Daniel J. Bernstein

Key agreementSRPThe Secure Remote Password Protocol, Thomas Wu, November 11th 1997
Key derivationNIST SP 800-108Recommendation for Key Derivation Using Pseudorandom Functions.
AESFIPS-197Advanced Encryption Standard (AES). Compliant with 128 bits, 192 bits, and 256 bits key size.
NIST SP 800-38ARecommendation for Block Cipher Modes of Operation - Methods and Techniques
NIST SP 800-38BRecommendation for Block Cipher Modes of Operation: The CMAC Mode for Authentication
NIST SP 800-38CRecommendation for Block Cipher Modes of Operation: The CCM Mode for Authentication and Confidentiality
ISO/IEC 9797-1AES CBC-MAC per ISO/IEC 9797-1 MAC algorithm 1
IEEE 802.15.4-2011IEEE Standard for Local and metropolitan area networks - Part 15.4: Low-Rate Wireless Personal Area Networks (LR-WPANs), Annex B.4: Specification of generic CCM* mode of operation
HashFIPS 180-4Secure Hash Standard (SHA1, SHA-224, SHA-256)
RFC2104HMAC: Keyed-Hashing for Message Authentication
RSAPKCS#1Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications v1.5/2.1. RSA signature verification supported up to key sizes of 4096 bits. RSA key generation supported up to key sizes of 3072 bits.
Diffie-HellmanANSI X9.42Public Key Cryptography for the Financial Services Industry: Agreement of Symmetric Keys Using Discrete Logarithm Cryptography
PKCS#3Diffie-Hellman Key-Agreement Standard
ECCANSI X9.63Public Key Cryptography for the Financial Services Industry - Key Agreement and Key Transport Using Elliptic Curve Cryptography
IEEE 1363Standard Specifications for Public-Key Cryptography
ANSI X9.62Public Key Cryptography For The Financial Services Industry: The Elliptic Curve Digital Signature Algorithm (ECDSA)
Ed25519Edwards-curve, Ed25519: high-speed high-security signatures, Daniel J. Bernstein, Niels Duif, Tanja Lange, Peter Schwabe, and Bo-Yin Yang
Curve25519Montgomery curve, Curve25519: new Diffie-Hellman speed records, Daniel J. Bernstein
FIPS 186-4Digital Signature Standard (DSS)
SEC 2Recommended Elliptic Curve Domain Parameters, Certicom Research
NIST SP 800-56A rev. 2Recommendation for Pair-Wise Key Establishment Schemes Using Discrete Logarithm Cryptography

Registers

Instances

InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CRYPTOCELLAPPLICATION0x50844000HFSNSANoCRYPTOCELL 312 security subsystem

Register overview

RegisterOffsetTZDescription
ENABLE0x500Enable CRYPTOCELL subsystem.

ENABLE

Address offset: 0x500

Enable CRYPTOCELL subsystem.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENABLEEnable or disable the CRYPTOCELL subsystem.
Disabled0CRYPTOCELL subsystem disabled.
Enabled1CRYPTOCELL subsystem enabled.

Accelerators

This chapter contains register interfaces for each of the hardware accelerator engines.

AES engine

The Advanced Encryption Standard (AES) hardware engine is designed according to FIPS197 for use in encrypt/decrypt and sign/verify operations for 128 bits, 192 bits, and 256 bits key sizes.

The following cipher modes are supported:

  • ECB
  • CBC
  • CBC-MAC
  • CMAC
  • CTR
  • CCM
  • CCM*
  • GCM
  • XEX/XTS
  • XCBC-MAC
  • OFB

The AES engine supports both non-tunneling and tunneling operations. In tunneling operation the AES engine can process data using one set of Key/Mode/IV values, and then immediately process the result from the first operating using another set of Key/Mode/IV values. This enables the engine to process both a data stream and the corresponding message authentication code (MAC) handling in parallel.

Note:
To ensure proper operation when writing 128 bits, 192 bits, and 256 bits AES keys, the write-only key registers of the AES engine must be written in ascending order, starting with:For 192 bits and 256 bits AES keys, this must be followed by:For 256 bits AES keys, this must be followed by:
Additionally, for tunneling operations using 128 bits, 192 bits, and 256 bits AES keys, the write-only key registers for the second stage must also be written in ascending order, starting with:For 192 bits and 256 bits second stage AES tunneling keys, this must be followed by:For 256 bits second stage AES tunneling keys, this must be followed by:

Cryptographic flow

The following section describe a simple cryptographic flow for this engine.


    
    uint8_t buf_dst[16] = { 0 };
    uint8_t buf_src[16] = { 0x81, 0x02, 0xF2, 0x40, 0xD5, 0xB9, 0x44, 0x59,
                            0xA2, 0xEB, 0x6F, 0xF2, 0x49, 0xF5, 0xEB, 0x94 };
   
    /* Enable CRYPTOCELL subsystem */
    NRF_CRYPTOCELL->ENABLE =  CRYPTOCELL_ENABLE_ENABLE_Enabled;

    /* Enable engine and DMA clock */
    NRF_CC_MISC->AES_CLK = CC_MISC_AES_CLK_ENABLE_Enable;
    NRF_CC_MISC->DMA_CLK = CC_MISC_DMA_CLK_ENABLE_Enable;

    /* Wait until crypto engine is Idle  */
    while (NRF_CC_CTL->CRYPTO_BUSY == CC_CTL_CRYPTO_BUSY_STATUS_Busy) { }

    /* Configure AES as cryptographic flow */
    NRF_CC_CTL->CRYPTO_CTL = CC_CTL_CRYPTO_CTL_MODE_AESActive;

    /* Configure AES engine control for decryption using ECB mode (default) */
    NRF_CC_AES->AES_CONTROL = CC_AES_AES_CONTROL_DEC_KEY0_Decrypt;

    /* Load the AES key value into the engine */
    NRF_CC_AES->AES_KEY_0[0] = 0x51515151;
    NRF_CC_AES->AES_KEY_0[1] = 0x52525252;
    NRF_CC_AES->AES_KEY_0[2] = 0x53535353;
    NRF_CC_AES->AES_KEY_0[3] = 0x54545454;

    /* Configure default init vector */
    NRF_CC_AES->AES_IV_0[0] = 0x0;
    NRF_CC_AES->AES_IV_0[1] = 0x0;
    NRF_CC_AES->AES_IV_0[2] = 0x0;
    NRF_CC_AES->AES_IV_0[3] = 0x0;

    /* Configure DMA output destination address */
    NRF_CC_DOUT->DST_MEM_ADDR = (uint32_t) buf_dst;
    NRF_CC_DOUT->DST_MEM_SIZE = (uint32_t) sizeof(buf_dst);

    /* Configure DMA input source address to start the cryptographic operation */
    NRF_CC_DIN->SRC_MEM_ADDR = (uint32_t) buf_src;
    NRF_CC_DIN->SRC_MEM_SIZE = (uint32_t) sizeof(buf_src);

    /* Wait on DOUT DMA interrupt */
    while(!(NRF_CC_HOST_RGF->IRR & CC_HOST_RGF_IRR_DOUT_TO_MEM_INT_Msk)) {}
    
    

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_AESAPPLICATION0x50845000HFSNSANoCRYPTOCELL AES engine
Register overview
RegisterOffsetTZDescription
AES_KEY_0[n]0x400AES key value to use in non-tunneling operations, or as the first tunnel stage key in tunneling operations. The initial AES_KEY_0[0] register holds the least significant bits [31:0] of the key value.
AES_KEY_1[n]0x420AES key value to use as the second tunnel stage key in tunneling operations. The initial AES_KEY_1[0] register holds the least significant bits [31:0] of the key value.
AES_IV_0[n]0x440AES Initialization Vector (IV) to use in non-tunneling operations, or as the first tunnel stage IV in tunneling operations. The initial AES_IV_0[0] register holds the least significant bits [31:0] of the IV.
AES_IV_1[n]0x450AES Initialization Vector (IV) to use as the second tunnel stage IV in tunneling operations. The initial AES_IV_1[0] register holds the least significant bits [31:0] of the IV.
AES_CTR[n]0x460AES counter (CTR) to use in non-tunneling and tunneling operations. The initial AES_CTR[0] register holds the least significant bits [31:0] of the CTR.
AES_BUSY0x470Status register for AES engine activity.
AES_CMAC_INIT0x47CWriting to this address triggers the AES engine to generate K1 and K2 for AES-CMAC operations.
AES_REMAINING_BYTES0x4BCThis register should be set with the amount of remaining bytes until the end of the current AES operation.
AES_CONTROL0x4C0Control the AES engine behavior.
AES_HW_FLAGS0x4C8Hardware configuration of the AES engine. Reset value holds the supported features.
AES_CTR_NO_INCREMENT0x4D8This register enables the AES CTR no increment mode in which the counter mode is not incremented between two blocks
AES_SW_RESET0x4F4Reset the AES engine.
AES_CMAC_SIZE0_KICK0x524Writing to this address triggers the AES engine to perform a CMAC operation with size 0. The CMAC result can be read from the AES_IV_0 register.
AES_KEY_0[n] (n=0..7)

Address offset: 0x400 + (n × 0x4)

AES key value to use in non-tunneling operations, or as the first tunnel stage key in tunneling operations. The initial AES_KEY_0[0] register holds the least significant bits [31:0] of the key value.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWVALUEAES non-tunneling or first tunnel stage key value.
AES_KEY_1[n] (n=0..7)

Address offset: 0x420 + (n × 0x4)

AES key value to use as the second tunnel stage key in tunneling operations. The initial AES_KEY_1[0] register holds the least significant bits [31:0] of the key value.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWVALUEAES second tunnel stage key value.
AES_IV_0[n] (n=0..3)

Address offset: 0x440 + (n × 0x4)

AES Initialization Vector (IV) to use in non-tunneling operations, or as the first tunnel stage IV in tunneling operations. The initial AES_IV_0[0] register holds the least significant bits [31:0] of the IV.

AES_IV_0 must be configured according to the selected AES mode:
  • AES CBC/CBC-MAC : Loaded with the IV.
  • XTS-AES : Loaded with the tweak value 'T'.

This register is a 'R/W change' register, as the written register values changes during processing.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEAES non-tunneling or first tunnel stage IV value.
AES_IV_1[n] (n=0..3)

Address offset: 0x450 + (n × 0x4)

AES Initialization Vector (IV) to use as the second tunnel stage IV in tunneling operations. The initial AES_IV_1[0] register holds the least significant bits [31:0] of the IV.

AES_IV_1 must be configured according to the selected AES mode:
  • AES CBC/CBC-MAC : Loaded with the IV.
  • XTS-AES : Loaded with the tweak value 'T'.

This register is a 'R/W change' register, as the written register values changes during processing.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEAES second tunnel stage IV value.
AES_CTR[n] (n=0..3)

Address offset: 0x460 + (n × 0x4)

AES counter (CTR) to use in non-tunneling and tunneling operations. The initial AES_CTR[0] register holds the least significant bits [31:0] of the CTR.

AES_CTR must be configured according to the selected AES mode:
  • AES CTR/GCTR : Loaded with the counter value.
  • XTS-AES : Loaded with the 'i' value.

This register is a 'R/W change' register, as the written register values changes during processing.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEAES CTR value.
AES_BUSY

Address offset: 0x470

Status register for AES engine activity.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSAES engine status.
Idle0AES engine is idle
Busy1AES engine is busy
AES_CMAC_INIT

Address offset: 0x47C

Writing to this address triggers the AES engine to generate K1 and K2 for AES-CMAC operations.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEGenerate K1 and K2 for the AES-CMAC operations.
Enable1Initialize AES-CMAC operations.
AES_REMAINING_BYTES

Address offset: 0x4BC

This register should be set with the amount of remaining bytes until the end of the current AES operation.

The AES engine counts down from this value to determine the last block or the block before the last blocks in mode AES CMAC and mode AES CCM.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUERemaining bytes util the end of the current AES operation.
AES_CONTROL

Address offset: 0x4C0

Control the AES engine behavior.

Bit number313029282726252423222120191817161514131211109876543210
IDPONMLKJIIHHGFEDDDCCCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWDEC_KEY0Set AES encrypt or decrypt mode in non-tunneling operations.
Encrypt0Perform AES encryption
Decrypt1Perform AES decryption
BRWMODE0_IS_CBC_CTSThis field allows to add distinction to the CBC and CTR modes defined in field MODE_KEY0. If MODE_KEY0 is set to CBC in combination with this field, AES mode is CBC-CTS. If MODE_KEY0 is set to CTR in combination with this field, AES mode is GCTR.
Disable0Disable CBC-CTS and GCTR mode
Enable1Enable CBC-CTS and GCTR mode
CRWMODE_KEY0Set the AES mode in non-tunneling operations, or the AES mode of the first stage in tunneling operations.
ECB0x0Electronic codebook mode
CBC0x1

Cipher block chaining mode

This CBC cipher mode can also be configured to run in several distinct modes:
  • CBC-CTS mode when combined with field MODE0_IS_CBC_CTS set.
  • CBC with ESSIV mode when combined with field CBC_IS_ESSIV set.
  • CBC BITLOCKER mode when combined with field CBC_IS_BITLOCKER set.
CTR0x2

Counter mode

This CTR cipher mode can also be configured to run GCTR mode when combined with field MODE0_IS_CBC_CTS set.

CBC_MAC0x3Cipher Block Chaining Message Authentication Code
XEX_XTS0x4Xor-Encrypt-Xor (XEX)-based tweaked-codebook mode with ciphertext stealing (XTS)
XCBC_MAC0x5AES in CBC mode with extensions to overcome fixed length limitations
OFB0x6AES Output FeedBack mode
CMAC0x7Cipher-based Message Authentication Code
DRWMODE_KEY1Set the AES mode of the second stage in tunneling operations
ECB0x0Electronic codebook mode
CBC0x1Cipher block chaining mode
CTR0x2Counter mode
CBC_MAC0x3Cipher block chaining message authentication code mode
XEX_XTS0x4Xor-Encrypt-Xor (XEX)-based tweaked-codebook mode with ciphertext stealing (XTS)
XCBC_MAC0x5AES in CBC mode with extensions to overcome fixed length limitations
OFB0x6AES Output FeedBack mode
CMAC0x7Cipher-based Message Authentication Code
ERWCBC_IS_ESSIVIf MODE_KEY0 is set to CBC, and this field is set, the mode is CBC with ESSIV.
Disable0Disable CBC with ESSIV mode
Enable1Enable CBC with ESSIV mode
FRWAES_TUNNELConfigure AES engine for standard non-tunneling or tunneling operations.
Disable0Standard non-tunneling operations
Enable1Enable tunneling operations
GRWCBC_IS_BITLOCKERIf MODE_KEY0 is set to CBC, and this field is set, the mode is CBC Bitlocker.
Disable0Disable CBC Bitlocker mode
Enable1Enable CBC Bitlocker mode
HRWNK_KEY0Set the AES key length in non-tunneling operations, or the AES key length of the first stage in tunneling operations.
128Bits0x0128 bits key length
192Bits0x1192 bits key length
256Bits0x2256 bits key length
IRWNK_KEY1Set the AES key length of the second stage in tunneling operations.
128Bits0x0128 bits key length
192Bits0x1192 bits key length
256Bits0x2256 bits key length
JRWAES_TUNNEL1_DECRYPTConfigure if first tunnel stage performs encrypt or decrypt operation.
Encrypt0Second tunnel stage performs encrypt operations.
Decrypt1Second tunnel stage performs decrypt operations.
KRWAES_TUN_B1_USES_PADDED_DATA_INFor tunneling operations this field determine the data that is fed to the second tunneling stage.
Disable0The output of the first block is used directly (standard tunneling operation).
Enable1The output of the first block is padded before use.
LRWAES_TUNNEL0_ENCRYPTConfigure if first tunnel stage performs encrypt or decrypt operation.
Decrypt0First tunnel stage performs decrypt operations.
Encrypt1First tunnel stage performs encrypt operations.
MRWAES_OUTPUT_MID_TUNNEL_DATAThis fields configure if the AES engine output is the result of the first or second tunneling stage.
SecondStage0Output result from the second tunnel stage (standard tunneling).
FirstStage1Output result from the first tunnel stage.
NRWAES_TUNNEL_B1_PAD_ENThis field configure if the input data to the second tunnel stage is to be padded with zeroes according to how many bytes are remaining.
Disable0The data input to the second tunnel stage is not padded with zeros.
Enable1The data input to the second tunnel stage is padded with zeros.
ORWAES_OUT_MID_TUN_TO_HASHThis field determines for AES-TO-HASH-AND-DOUT tunneling operations, whether the AES outputs to the HASH the result of the first or the second tunneling stage.
SecondStage0The AES engine writes to the HASH the result of the second tunnel stage.
FirstStage1The AES engine writes to the HASH the result of the first tunnel stage.
PRWDIRECT_ACCESSUsing direct access and not the DIN-DOUT DMA interface
Disable0Access using the DIN-DOUT DMA interface
Enable1Access using direct access
AES_HW_FLAGS

Address offset: 0x4C8

Hardware configuration of the AES engine. Reset value holds the supported features.

Bit number313029282726252423222120191817161514131211109876543210
IDKJIHGFEDCBA
Reset 0x00001D0B00000000000000000001110100001011
IDR/WFieldValue IDValueDescription
ARSUPPORT_256_192_KEYIf this flag is set, the engine support 192 bits and 256 bits key size.
BRAES_LARGE_RKEKIf this flag is set, the engine support AES_LARGE_RKEK.
CRDPA_CNTRMSR_EXISTIf this flag is set, the engine support DPA countermeasures.
DRCTR_EXISTIf this flag is set, the engine support AES CTR mode.
ERONLY_ENCRYPTIf this flag is set, the engine only support encrypt operations.
FRUSE_SBOX_TABLEIf this flag is set, the engine uses SBOX tables.
GRUSE_5_SBOXESIf this flag is set, the engine uses 5 SBOX where each AES round takes 4 cycles.
HRAES_SUPPORT_PREV_IVIf this flag is set, the engine contains the PREV_IV register for faster AES XCBC MAC calculation.
IRAES_TUNNEL_EXISTIf this flag is set, the engine support tunneling operations.
JRSECOND_REGS_SET_EXISTIf this flag is set, the engine support a second register set for tunneling operations.
KRDFA_CNTRMSR_EXISTIf this flag is set, the engine support DFA countermeasures.
AES_CTR_NO_INCREMENT

Address offset: 0x4D8

This register enables the AES CTR no increment mode in which the counter mode is not incremented between two blocks

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENABLEThis field enables the AES CTR no increment mode in which the counter mode is not incremented between two blocks
Disable0Counter always incremented between blocks
Enable1Do not increment counter between blocks
AES_SW_RESET

Address offset: 0x4F4

Reset the AES engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the AES engine. The reset takes 4 CPU clock cycles to complete.
Enable1Reset AES engine.
AES_CMAC_SIZE0_KICK

Address offset: 0x524

Writing to this address triggers the AES engine to perform a CMAC operation with size 0. The CMAC result can be read from the AES_IV_0 register.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEForce AES CMAC operation with size 0.
Disable0Normal AES CMAC operation
Enable1Force CMAC operation with size 0

CHACHA engine

The ChaCha algorithm is a family of stream ciphers.

The ChaCha family of stream ciphers can be used as both a stand-alone algorithm, and in combination with the Poly1305 authenticator to form an Authenticated Encryption with Associated Data (AEAD) algorithm as defined in RFC7539 for IETF protocols.

The CHACHA engine provide acceleration for the stream encryption, while the PKA engine is used for acceleration of the Poly1305 authenticator. The core of the ChaCha algorithm is a hash function which is based on rotation operations. In the default configuration the hash function consist of 20 rounds of rotation permutations. The implementation support ChaCha stream ciphers using key sizes up to 256 bits in 8, 12 and 20 rounds. The ChaCha20/Poly1305 combination is perfectly suited for embedded environments, and can achieve much higher throughput than AES using similar power consumption and execution time.

Note: To ensure proper operation when writing 128 bits CHACHA keys, the write-only key registers of the CHACHA engine must be written in ascending order, starting with:For 256 bits CHACHA keys, this must be followed by:

Cryptographic flow

The following section describe a simple cryptographic flow for this engine.


    
    uint8_t buf_dst[16] = { 0 };
    uint8_t buf_src[16] = { 0x18, 0x35, 0x9B, 0x75, 0x18, 0x6F, 0x33, 0xBE,
                            0x22, 0x0A, 0x3D, 0xB7, 0x66, 0xFD, 0x98, 0x35 };
  
    /* Enable CRYPTOCELL subsystem */
    NRF_CRYPTOCELL->ENABLE = CRYPTOCELL_ENABLE_ENABLE_Enabled;

    /* Enable engine and DMA clock */
    NRF_CC_MISC->CHACHA_CLK = CC_MISC_CHACHA_CLK_ENABLE_Enable;
    NRF_CC_MISC->DMA_CLK = CC_MISC_DMA_CLK_ENABLE_Enable;

    /* Wait until crypto engine is Idle  */
    while (NRF_CC_CTL->CRYPTO_BUSY == CC_CTL_CRYPTO_BUSY_STATUS_Busy) { }

    /* Configure CHACHA as cryptographic flow */
    NRF_CC_CTL->CRYPTO_CTL = CC_CTL_CRYPTO_CTL_MODE_ChaChaActive;
  
    /* Configure testing NONCE */
    NRF_CC_CHACHA->CHACHA_IV[0] = 0xBBBBAAAA;
    NRF_CC_CHACHA->CHACHA_IV[1] = 0x22221111;
  
    /* Load the CHACHA test key value into the engine */
    NRF_CC_CHACHA->CHACHA_KEY[0] = 0x51515151;
    NRF_CC_CHACHA->CHACHA_KEY[1] = 0x52525252;
    NRF_CC_CHACHA->CHACHA_KEY[2] = 0x53535353;
    NRF_CC_CHACHA->CHACHA_KEY[3] = 0x54545454;
    NRF_CC_CHACHA->CHACHA_KEY[4] = 0x51515151;
    NRF_CC_CHACHA->CHACHA_KEY[5] = 0x52525252;
    NRF_CC_CHACHA->CHACHA_KEY[6] = 0x53535353;
    NRF_CC_CHACHA->CHACHA_KEY[7] = 0x54545454;
  
    /* Configure CHACHA mode - using default (0x0), adding new message init */
    NRF_CC_CHACHA->CHACHA_CONTROL =
      (CC_CHACHA_CHACHA_CONTROL_INIT_Enable <<
       CC_CHACHA_CHACHA_CONTROL_INIT_Pos);
  
    /* Configure DMA output destination address */
    NRF_CC_DOUT->DST_MEM_ADDR = (uint32_t) buf_dst;
    NRF_CC_DOUT->DST_MEM_SIZE = (uint32_t) sizeof(buf_dst);

    /* Configure DMA input source address to start the cryptographic operation */
    NRF_CC_DIN->SRC_MEM_ADDR = (uint32_t) buf_src;
    NRF_CC_DIN->SRC_MEM_SIZE = (uint32_t) sizeof(buf_src);
  
    /* Wait on DOUT DMA interrupt */
    while(!(NRF_CC_HOST_RGF->IRR & CC_HOST_RGF_IRR_DOUT_TO_MEM_INT_Msk)) {}
    
    

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_CHACHAAPPLICATION0x50845000HFSNSANoCRYPTOCELL CHACHA engine
Register overview
RegisterOffsetTZDescription
CHACHA_CONTROL0x380Control the CHACHA engine behavior.
CHACHA_VERSION0x384CHACHA engine HW version
CHACHA_KEY[n]0x388CHACHA key value to use. The initial CHACHA_KEY[0] register holds the least significant bits [31:0] of the key value.
CHACHA_IV[n]0x3A8CHACHA Initialization Vector (IV) to use. The IV is also known as the nonce.
CHACHA_BUSY0x3B0Status register for CHACHA engine activity.
CHACHA_HW_FLAGS0x3B4Hardware configuration of the CHACHA engine. Reset value holds the supported features.
CHACHA_BLOCK_CNT_LSB0x3B8Store the LSB value of the block counter, in order to support suspend/resume of operation
CHACHA_BLOCK_CNT_MSB0x3BCStore the MSB value of the block counter, in order to support suspend/resume of operation
CHACHA_SW_RESET0x3C0Reset the CHACHA engine.
CHACHA_POLY1305_KEY[n]0x3C4

The auto-generated key to use in Poly1305 MAC calculation.

The initial CHACHA_POLY1305_KEY[0] register holds the least significant bits [31:0] of the key value.

CHACHA_ENDIANNESS0x3E4CHACHA engine data order configuration.
CHACHA_DEBUG0x3E8Debug register for the CHACHA engine
CHACHA_CONTROL

Address offset: 0x380

Control the CHACHA engine behavior.

Bit number313029282726252423222120191817161514131211109876543210
IDGFEEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHACHA_OR_SALSARun engine in ChaCha or Salsa mode
ChaCha0Run engine in ChaCha mode
Salsa1Run engine in Salsa mode
BRWINITPerform initialization for a new message
Disable0Message already initialized
Enable1Initialize new message
CRWGEN_KEY_POLY1305Generate the key to use in Poly1305 message authentication code calculation.
Disable0Do not generate Poly1305 key
Enable1Generate Poly1305 key
DRWKEY_LENKey length selection.
256Bits0Use 256 bits key length
128Bits1Use 128 bits key length
ERWNUM_OF_ROUNDSSet number of permutation rounds, default value is 20.
Default0Use 20 rounds of rotation (default)
12Rounds1Use 12 rounds of rotation
8Rounds2Use 8 rounds of rotation
FRWRESET_BLOCK_CNTReset block counter for new messages
Disable0Use current block counter value
Enable1Reset block counter value to zero
GRWUSE_IV_96BITUse 96 bits Initialization Vector (IV)
Disable0Use default size IV of 64 bit
Enable1The IV is 96 bits
CHACHA_VERSION

Address offset: 0x384

CHACHA engine HW version

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARCHACHA_VERSION
CHACHA_KEY[n] (n=0..7)

Address offset: 0x388 + (n × 0x4)

CHACHA key value to use. The initial CHACHA_KEY[0] register holds the least significant bits [31:0] of the key value.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWVALUECHACHA key value.
CHACHA_IV[n] (n=0..1)

Address offset: 0x3A8 + (n × 0x4)

CHACHA Initialization Vector (IV) to use. The IV is also known as the nonce.

The size of the nonce is controlled from register CHACHA_CONTROL.

For 64 bits IV size the nonce value must be encoded using:
  • CHACHA_IV[0] : Bits [31:0] of the nonce
  • CHACHA_IV[1] : Bits [63:32] of the nonce
For 96 bits IV size the nonce value must be encoded using:
  • CHACHA_BLOCK_CNT_MSB : Bits [31:0] of the nonce
  • CHACHA_IV[0] : Bits [63:32] of the nonce
  • CHACHA_IV[1] : Bits [95:64] of the nonce
Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUECHACHA IV value.
CHACHA_BUSY

Address offset: 0x3B0

Status register for CHACHA engine activity.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSCHACHA engine status.
Idle0CHACHA engine is idle
Busy1CHACHA engine is busy
CHACHA_HW_FLAGS

Address offset: 0x3B4

Hardware configuration of the CHACHA engine. Reset value holds the supported features.

Bit number313029282726252423222120191817161514131211109876543210
IDCBA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARCHACHA_EXISTSIf this flag is set, the engine include ChaCha support
BRSALSA_EXISTSIf this flag is set, the engine include Salsa support
CRFAST_CHACHAIf this flag is set, the next matrix calculated when the current one is written to data output path.
CHACHA_BLOCK_CNT_LSB

Address offset: 0x3B8

Store the LSB value of the block counter, in order to support suspend/resume of operation

The two first words (n) in the last row of the cipher matrix are the block counter. At the end of each block (512b), the block counter for the next block is written by HW to register CHACHA_BLOCK_CNT_LSB and register CHACHA_BLOCK_CNT_MSB. If starting a new message the block counter must also be reset.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEThis register holds the ChaCha block counter bits [31:0] and must be read and written during respectively suspend and resume operations.
CHACHA_BLOCK_CNT_MSB

Address offset: 0x3BC

Store the MSB value of the block counter, in order to support suspend/resume of operation

For the description of register CHACHA_BLOCK_CNT_MSB, see register CHACHA_BLOCK_CNT_LSB.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEThis register holds the ChaCha block counter bits [63:32] and must be read and written during respectively suspend and resume operations.
CHACHA_SW_RESET

Address offset: 0x3C0

Reset the CHACHA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the CHACHA engine. The reset takes 4 CPU clock cycles to complete.
Enable1Reset CHACHA engine.
CHACHA_POLY1305_KEY[n] (n=0..7)

Address offset: 0x3C4 + (n × 0x4)

The auto-generated key to use in Poly1305 MAC calculation.

The initial CHACHA_POLY1305_KEY[0] register holds the least significant bits [31:0] of the key value.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARVALUEPoly1305 key value.
CHACHA_ENDIANNESS

Address offset: 0x3E4

CHACHA engine data order configuration.

Bit number313029282726252423222120191817161514131211109876543210
IDEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCHACHA_DIN_WORD_ORDERChange the word order of the input data.
Default0Use default word order for 128-bits input, where words are ordered as follows: w0, w1, w2, w3.
Reverse1Reverses the word order for 128-bits input, where words are re-ordered as follows: w3, w2, w1, w0.
BRWCHACHA_DIN_BYTE_ORDERChange the byte order of the input data.
Default0Use default byte order within each input word, where bytes are ordered as follows: B0, B1, B2, B3.
Reverse1Reverse the byte order within each input word, where bytes are re-ordered as follows: B3, B2, B1, B0.
CRWCHACHA_CORE_MATRIX_LBE_ORDERChange the quarter of a matrix order in the engine.
Default0Use default quarter of matrix order, where quarters are ordered as follows: q0, q1, q2, q3. Each quarter represents a 128-bits section of the matrix.
Reverse1Reverse the order of matrix quarters, where quarters are re-ordered as follows: q3, q2, q1, q0. Each quarter represents a 128-bits section of the matrix.
DRWCHACHA_DOUT_WORD_ORDERChange the word order of the output data.
Default0Uses default word order for 128-bits output, where words are ordered as follows: w0, w1, w2, w3.
Reverse1Reverse the word order for 128-bits output, where words are re-ordered as follows: w3, w2, w1, w0.
ERWCHACHA_DOUT_BYTE_ORDERChange the byte order of the output data.
Default0Use default byte order within each output word, where bytes are ordered as follows: B0, B1, B2, B3.
Reverse1Reverse the byte order within each output word, where bytes are re-ordered as follows: B3, B2, B1, B0.
CHACHA_DEBUG

Address offset: 0x3E8

Debug register for the CHACHA engine

Bit number313029282726252423222120191817161514131211109876543210
IDAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARFSM_STATEReflects the debug state of the CHACHA FSM.
IDLE_STATE0CHACHA FSM is in idle state
INIT_STATE1CHACHA FSM is in init state
ROUNDS_STATE2CHACHA FSM is in rounds state
FINAL_STATE3CHACHA FSM is in final state

GHASH engine

The GHASH engine is suitable for generating Galois hashes for message authentication.

AES in Galois counter mode (AES-GCM) is an authenticated encryption with additional data (AEAD) block cipher mode of operation which provide confidentiality, integrity and authentication of data.

The CRYPTOCELL subsystem is able to perform single-pass AES in galois counter mode (GCM), where the AES engine is used for data confidentiality and the GHASH engine provide data integrity and authentication.

Note: To ensure proper operation, the write-only key registers of the GHASH engine must be written in ascending order, starting with:

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_GHASHAPPLICATION0x50845000HFSNSANoCRYPTOCELL GHASH engine
Register overview
RegisterOffsetTZDescription
GHASH_SUBKEY[n]0x960GHASH subkey value to use. The initial GHASH_SUBKEY[0] register holds the least significant bits [31:0] of the subkey value.
GHASH_IV[n]0x970GHASH Initialization Vector (IV) to use. The initial GHASH_IV[0] register holds the least significant bits [31:0] of the IV.
GHASH_BUSY0x980Status register for GHASH engine activity.
GHASH_INIT0x984Configure the GHASH engine for a new GHASH operation.
GHASH_SUBKEY[n] (n=0..3)

Address offset: 0x960 + (n × 0x4)

GHASH subkey value to use. The initial GHASH_SUBKEY[0] register holds the least significant bits [31:0] of the subkey value.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWVALUEGHASH subkey value.
GHASH_IV[n] (n=0..3)

Address offset: 0x970 + (n × 0x4)

GHASH Initialization Vector (IV) to use. The initial GHASH_IV[0] register holds the least significant bits [31:0] of the IV.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEGHASH IV value.
GHASH_BUSY

Address offset: 0x980

Status register for GHASH engine activity.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSGHASH engine status.
Idle0GHASH engine is idle
Busy1GHASH engine is busy
GHASH_INIT

Address offset: 0x984

Configure the GHASH engine for a new GHASH operation.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEInitialize a new GHASH operation.
Enable1Initialize GHASH operation

HASH engine

The HASH engine is designed according to FIPS 180-4, and support both the SHA1 and SHA2 family of digest algorithms up to 256 bits.

The following SHA modes are supported:
  • SHA-1
  • SHA-224
  • SHA-256
Note:
To ensure proper operation, the FIPS 180-4 defined initial hash values written to the registers of the HASH engine must be written in descending order, starting with:

Cryptographic flow

The following section describe a simple cryptographic flow for this engine.


    
    uint8_t buf_src[32] =  {
          0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,
          0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,
          0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,
          0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA,0xFA };

    /* Enable CRYPTOCELL subsystem */
    NRF_CRYPTOCELL->ENABLE = CRYPTOCELL_ENABLE_ENABLE_Enabled;

    /* Enable engine and DMA clock */
    NRF_CC_MISC->HASH_CLK = CC_MISC_HASH_CLK_ENABLE_Enable;
    NRF_CC_MISC->DMA_CLK = CC_MISC_DMA_CLK_ENABLE_Enable;

    /* Wait until hash engine is Idle  */
    while (NRF_CC_CTL->HASH_BUSY == CC_CTL_HASH_BUSY_STATUS_Busy) {}

    /* Clear all interrupts */
    NRF_CC_HOST_RGF->ICR = 0xFFFFFFFF;

    /* Configure HASH as cryptographic flow */
    NRF_CC_CTL->CRYPTO_CTL = CC_CTL_CRYPTO_CTL_MODE_HashActive;

    /* Configure engine for SHA256 */
    NRF_CC_HASH->HASH_CONTROL = CC_HASH_HASH_CONTROL_MODE_SHA256;
    
    /* Enable automatic HW padding */
    NRF_CC_HASH->HASH_PAD = CC_HASH_HASH_PAD_ENABLE_Enable;
    NRF_CC_HASH->HASH_PAD_AUTO = CC_HASH_HASH_PAD_AUTO_HWPAD_Enable;

    /* Configure initial SHA256 values */
    NRF_CC_HASH->HASH_H[7] = 0x5BE0CD19;
    NRF_CC_HASH->HASH_H[6] = 0x1F83D9AB;
    NRF_CC_HASH->HASH_H[5] = 0x9B05688C;
    NRF_CC_HASH->HASH_H[4] = 0x510E527F;
    NRF_CC_HASH->HASH_H[3] = 0xA54FF53A;
    NRF_CC_HASH->HASH_H[2] = 0x3C6EF372;
    NRF_CC_HASH->HASH_H[1] = 0xBB67AE85;
    NRF_CC_HASH->HASH_H[0] = 0x6A09E667;

    /* Configure DMA input source address to start the cryptographic operation */
    NRF_CC_DIN->SRC_MEM_ADDR = (uint32_t) buf_src;
    NRF_CC_DIN->SRC_MEM_SIZE = (uint32_t) sizeof(buf_src);

    /* Wait on DIN DMA interrupt indicating data has been fetched */
    while(!(NRF_CC_HOST_RGF->IRR & CC_HOST_RGF_IRR_MEM_TO_DIN_INT_Msk)) {}

    /* Wait until hash engine is Idle */
    while (NRF_CC_CTL->HASH_BUSY == CC_CTL_HASH_BUSY_STATUS_Busy) {}

    /* Calculated SHA256 digest now available in 
    NRF_CC_HASH->HASH_H[0] to NRF_CC_HASH->HASH_H[7]  */
    
    

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_HASHAPPLICATION0x50845000HFSNSANoCRYPTOCELL HASH engine
Register overview
RegisterOffsetTZDescription
HASH_H[n]0x640HASH_H value registers. The initial HASH_H[0] register holds the least significant bits [31:0] of the value.
HASH_PAD_AUTO0x684Configure the HASH engine to automatically pad data at the end of the DMA transfer to complete the digest operation.
HASH_XOR_DIN0x688Perform an XOR operation of the DIN DMA engine input data being fed into the HASH engine. Set this register to '0' if XOR is not required.
HASH_INIT_STATE0x694Configure HASH engine initial state registers.
HASH_SELECT0x6A4Select HASH or GHASH engine as the digest engine to use.
HASH_CONTROL0x7C0Control the HASH engine behavior.
HASH_PAD0x7C4Enable the hardware padding feature of the HASH engine.
HASH_PAD_FORCE0x7C8Force the hardware padding operation to trigger if the input data length is zero bytes.
HASH_CUR_LEN_00x7CCBits [31:0] of the number of bytes that have been digested so far.
HASH_CUR_LEN_10x7D0Bits [63:32] of the number of bytes that have been digested so far.
HASH_HW_FLAGS0x7DCHardware configuration of the HASH engine. Reset value holds the supported features.
HASH_SW_RESET0x7E4Reset the HASH engine.
HASH_ENDIANNESS0x7E8Configure the endianness of HASH data and padding generation.
HASH_H[n] (n=0..7)

Address offset: 0x640 + (n × 0x4)

HASH_H value registers. The initial HASH_H[0] register holds the least significant bits [31:0] of the value.

This register is a 'R/W change' register, as the written register values changes during processing.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEWrite the initial hash value before start of digest operation, and read the final hash value result after the digest operation has been completed.
HASH_PAD_AUTO

Address offset: 0x684

Configure the HASH engine to automatically pad data at the end of the DMA transfer to complete the digest operation.

This feature can only be used if HASH_PAD is enabled, and must be disabled after a digest operation is completed. In the event of zero bytes input data length the hardware padding must be manually triggered using register HASH_PAD_FORCE.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWHWPAD

Enable automatic padding in hardware.

Disable this register when the digest operation is completed.

Disable0Do not enable automatic hardware padding.
Enable1Enable automatic hardware padding.
HASH_XOR_DIN

Address offset: 0x688

Perform an XOR operation of the DIN DMA engine input data being fed into the HASH engine. Set this register to '0' if XOR is not required.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEThe value to XOR with the HASH engine input data.
HASH_INIT_STATE

Address offset: 0x694

Configure HASH engine initial state registers.

Data fetched using the DIN DMA engine will be loaded into initial hash value registers HASH_H[n] (n=0..7) or used as IV for AES MAC.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWLOAD

Enable loading of data to initial state registers. Digest/IV for HASH/AES_MAC.

Disable this register when loading of data using DIN DMA is done.

Disable0Disable loading of data to initial state registers.
Enable1Enable loading of data to initial state registers.
HASH_SELECT

Address offset: 0x6A4

Select HASH or GHASH engine as the digest engine to use.

Bit number313029282726252423222120191817161514131211109876543210
IDAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENGINESelect HASH or GHASH engine as the digest engine.
HASH0Select the HASH engine
GHASH2

Select the GHASH engine

Selecting the GHASH engine will automatically enable the GHASH engine clock

HASH_CONTROL

Address offset: 0x7C0

Control the HASH engine behavior.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWMODESelect HASH mode to execute
SHA11Select SHA1 mode
SHA2562Select SHA256 mode
SHA22410Select SHA224 mode
HASH_PAD

Address offset: 0x7C4

Enable the hardware padding feature of the HASH engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARWENABLEConfigure hardware padding feature.
Disable0Disable hardware padding feature.
Enable1Enable hardware padding feature.
HASH_PAD_FORCE

Address offset: 0x7C8

Force the hardware padding operation to trigger if the input data length is zero bytes.

This feature can only be used if HASH_PAD is enabled, and must be disabled after a digest operation is completed.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENABLE

Trigger hardware padding operation.

Disable this register when the digest operation is completed.

Disable0Do not force hardware padding to trigger.
Enable1Force hardware padding to trigger.
HASH_CUR_LEN_0

Address offset: 0x7CC

Bits [31:0] of the number of bytes that have been digested so far.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEBits [31:0] of current length of digested data in bytes.
HASH_CUR_LEN_1

Address offset: 0x7D0

Bits [63:32] of the number of bytes that have been digested so far.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVALUEBits [63:32] of current length of digested data in bytes.
HASH_HW_FLAGS

Address offset: 0x7DC

Hardware configuration of the HASH engine. Reset value holds the supported features.

Bit number313029282726252423222120191817161514131211109876543210
IDJIHGFEDCCCCBBBBAAAA
Reset 0x0001200100000000000000010010000000000001
IDR/WFieldValue IDValueDescription
ARCWIndicates the number of concurrent words the hash is using to compute signature.
One1One concurrent word used by hash during signature generation
Two2Two concurrent words used by hash during signature generation
BRCHIndicate if Hi adders are present for each Hi value or 1 adder is shared for all Hi.
One0One Hi value is updated at a time.
All1All Hi values are updated at the same time.
CRDWDetermine the granularity of word size.
32Bits032 bits word data.
64Bits164 bits word data.
DRSHA_512_EXISTSIf this flag is set, the engine include SHA-512 support.
ERPAD_EXISTSIf this flag is set, the engine include pad block support.
FRMD5_EXISTSIf this flag is set, the engine include MD5 support.
GRHMAC_EXISTSIf this flag is set, the engine include HMAC support.
HRSHA_256_EXISTSIf this flag is set, the engine include SHA-256 support.
IRHASH_COMPARE_EXISTSIf this flag is set, the engine include compare digest logic.
JRDUMP_HASH_TO_DOUT_EXISTSIf this flag is set, the engine include HASH to DOUT support.
HASH_SW_RESET

Address offset: 0x7E4

Reset the HASH engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the HASH engine. The reset takes 4 CPU clock cycles to complete.
Enable1Reset HASH engine.
HASH_ENDIANNESS

Address offset: 0x7E8

Configure the endianness of HASH data and padding generation.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARWENDIANEndianness of HASH data and padding generation. The default value is little-endian.
LittleEndian0Use little-endian format for data and padding
BigEndian1Use big-endian format for data and padding

PKA engine

The Public Key Accelerator (PKA) engine is designed to accelerate asymmetric cryptographic algorithms.

The PKA design is a general purpose bignum modular ALU capable of supporting operand sizes between 128-4160 bits in the following operations:
  • Modular exponentiation/inversion
  • Modular/regular addition/subtraction
  • Modular/regular increment/decrement
  • Modular/regular multiplication/division
  • Logical operations (AND, OR, XOR, SHIFT)

The PKA engine can be used to hardware accelerate various arithmentic regular and modular mathematical operations involving very large numbers which are used in both RSA and Elliptic Curve Cryptographic (ECC) public-key cryptosystems.

Virtual memory mapping

The PKA engine uses virtual register mapping to facilitate flexible data management across a variety of cryptographic algorithms.

Figure 3. Virtual register mapping

All virtual registers must be defined and configured in the dedicated PKA SRAM before they can be accessed by the PKA engine during processing. This SRAM acts as a private memory pool for the PKA engine, where all other access is blocked during processing. The virtual registers are used as input for the PKA calculation and as a placeholder for intermediate and final results.

The PKA engine can be configured to perform multiple operations on virtual operand registers and store the result of the operation in a virtual result or intermediate result register. During the next iteration the PKA engine can then use an intermediate result register from a previous operation as a virtual operand register for further calculations. This re-mapping strategy enables the PKA engine to efficiently handle complex cryptographic operations.

In total there are 32 virtual registers that can be mapped to different PKA SRAM regions using register MEMORY_MAP[n] (n=0..31), denoted as virtual register R0 - R31. Four of these 32 virtual registers are special registers, and their register index mapping can be changed using register N_NP_T0_T1_ADDR:
  • N - holds the modulus number, by default mapped to virtual register R0. This register is used by the PKA engine for modular operations, and its modulus N value does not change during processing.
  • Np - holds the inverse modulus number, by default mapped to virtual register R1. This register is used by the PKA engine for the Barrett reduction algorithm, and its inverse modulus Np value does not change during processing.
  • T0 - temporary register, by default mapped to virtual register R30. This register is for internal use by the PKA engine.
  • T1 - temporary register, by default mapped to virtual register R31. This register is for internal use by the PKA engine.

All virtual registers must be 64 bits word size aligned, and the size of the virtual registers must be at least the size of the largest operand plus an extra 64 bits for internal PKA calculations. These extra 64 bits must be initialized to zero. This is applicable for all virtual registers R0 - R31. The configured virtual register size does not define the size of the operation, it only limits the largest operand size that can be used with the corresponding virtual register.

The memory map configuration can be altered dynamically by the PKA engine, depending on the operation. Not all virtual registers need to be configured for each operation. It is recommended to re-write the memory map configuration after a reset.

Engine operations

The PKA engine can perform multiple operations on operands stored in virtual registers.

PKA processing is triggered by writing to register OPCODE. This register contains both the PKA operation to perform, and which virtual register indexes to use as operand inputs, tag, and intermediate or final result output of the operation. Register PKA_DONE will indicate Processing until the PKA operation is done, after which the result can be read from the result register in PKA SRAM.

The following OPCODE virtual register indexes must be configured prior to starting the PKA engine:
  • Field REG_R configure which virtual register to use for storing an intermediate or final result.
  • Field REG_A and REG_B configure which virtual registers to use as operand input. The operand input fields can be interpreted by the PKA engine as constants instead of virtual register indexes by setting fields CONST_A and CONST_B for certain operations, as documented in the table below.
  • The size of the operands are set in field LEN, which must point to one of the pre-configured operand sizes in bits configured in register PKA_L[n] (n=0..7).
OPCODE overview

Supported PKA operation codes and the corresponding required virtual register configurations.

Table 3. PKA OPCODE descriptions
OPCODEOperation
TerminateTerminate ongoing PKA operation
AddInc

Add or Increment

  • ADD: REG_R = REG_A + REG_B
  • INC: REG_R = REG_A + 0x1, when REG_B and CONST_B are 0x1

SubDecNeg

Subtract, Decrement, or Negate

  • SUB: REG_R = REG_A - REG_B
  • DEC: REG_R = REG_A - 0x1, when REG_B and CONST_B are 0x1
  • NEG: REG_R = 0x0 - REG_B, when REG_A is 0x0 and CONST_A is 0x1
ModAddInc

Modular Add or Modular Increment

  • ModADD: REG_R = (REG_A + REG_B) % REG_N
  • ModINC: REG_R = (REG_A + 0x1) % REG_N, when REG_B and CONST_B are 0x1
ModSubDecNeg

Modular Subtract, Modular Decrement, or Modular Negate

  • ModSUB: REG_R = (REG_A - REG_B) % REG_N
  • ModDEC: REG_R = (REG_A - 0x1) % REG_N, when REG_B and CONST_B is 0x1
  • ModNEG: REG_R = (0x0 - REG_B) % REG_N, when REG_A is 0x0
ANDTST0CLR0

And, Test bit 0, or Clear

  • AND: REG_R = REG_A & REG_B
  • TST0: REG_R = REG_A & 0x1, when REG_B is 0x1, and CONST_B is 0x1
  • CLR: REG_R = 0x0, when REG_B is 0x0 and CONST_B is 0x1. REG_A is ignored.
ORCOPYSET0

Or, Copy, or Set bit 0

  • OR: REG_R = REG_A | REG_B
  • COPY: REG_R = REG_A, when REG_B is 0x0 and CONST_B is 0x1.
  • SET0: REG_R = REG_A | 0x1, when REG_B and CONST_B is 0x1.
XORFLP0INVCMP

XOR, Flip bit 0, Invert, or Compare

  • XOR: REG_R = REG_A XOR REG_B
  • FLP0: REG_R = REG_A XOR 0x1, when REG_B and CONST_B is 0x1.
  • INV: REG_R = REG_A XOR 0xFFFFFFFF, when REG_B is 0x1F and CONST_B is 0x1.
  • CMP: REG_A XOR REG_B, when DISCARD_R is 0x1, result of comparison is provided by the ALU_OUT_ZERO flag in PKA_STATUS register.
SHR0

Shift right 0. This operation performs a logical right shift on the contents of REG_A by a specified number of bit positions and stores the result in REG_R. The leftmost bits of REG_R that are vacated by the shift operation are filled with zeros.

REG_R = REG_A >> s, CONST_B must be set to 0x1. To perform s shifts, REG_B should be set to s - 1 (where 1 <= s <= 31).

SHR1Shift right 1. This operation performs a logical right shift on the contents of REG_A by a specified number of bit positions and stores the result in REG_R. The leftmost bits of REG_R that are vacated by the shift operation are filled with ones.

REG_R = REG_A >> s, CONST_B must be set to 0x1. To perform s shifts, REG_B should be set to s - 1 (where 1 <= s <= 31).

SHL0Shift left 0. This operation performs a logical left shift on the contents of REG_A by a specified number of bit positions and stores the result in REG_R. The leftmost bits of REG_R that are vacated by the shift operation are filled with zeros.

REG_R = REG_A << s, CONST_B must be set to 0x1. To perform s shifts, REG_B should be set to s - 1 (where 1 <= s <= 31).

SHL1Shift left 1. This operation performs a logical left shift on the contents of REG_A by a specified number of bit positions and stores the result in REG_R. The leftmost bits of REG_R that are vacated by the shift operation are filled with ones.

REG_R = REG_A << s, CONST_B must be set to 0x1. To perform s shifts, REG_B should be set to s - 1 (where 1 <= s <= 31).

MulLowMultiply Low. This operation performs a multiplication of the values in REG_A and REG_B and stores the result in the destination register REG_R. Any bits of the product that exceed the operand size are discarded, effectively keeping only the least significant bits (LSBs) that fit within the operand size.

REG_R = (REG_A * REG_B) & operand size mask

ModMul

Modular Multiply.

REG_R = (REG_A * REG_B) % REG_N
ModMulNThe output of this operation is a number that is potentially larger than the modulus N, but guaranteed to be smaller than 2N. Assuming REG_A and REG_B are already reduced modulo N or are less than N, the operation is simply REG_R = (REG_A * REG_B).
ModExp

Modular Exponentiation.

REG_R = (REG_A ^ REG_B) % REG_N
Division

Integer Division. This operation performs integer division of the value in REG_A by the value in REG_B. The quotient of the division is stored in REG_R, and the remainder is stored back in REG_A.

  • REG_R = REG_A / REG_B
  • REG_A = REG_A % REG_B

If REG_B is zero (0x0), the operation is invalid, and the divide by zero bit in the status register is set to indicate a division error.

Note: PKA division operations with operands larger than 4K bits return erroneous results.
ModInvModular Inversion.

REG_R = 1/REG_B % REG_N

ModDiv

Modular division is done by calculating the modular inverse of the divisor, check that the inverse value exists by examining the GCD, and then use modular multiplication to multiply the inverse result by the divided.

REG_A = (REG_A * REG_B^(-1)) % REG_N

MulHighMultiply High. This operation multiplies REG_A by REG_B and captures the high-order bits of the result that exceed the operand size. It places these significant bits, along with an additional PKA_WORD number of bits, into the destination register REG_R.

REG_R = (REG_A * REG_B) >> operand size

ModMLAC

Modular Multiplication Acceleration. Performs a modular multiplication and addition. REG_C is defined using the operation tag.

REG_R = ((REG_A * REG_B) + REG_C) % REG_N
ModMLACNRModular Multiplication Acceleration No Reduction. Same as ModMLAC, but this omits the final reduction of the result.
Reduction

Reduction. This operation performs a modular reduction, where the result REG_R is the remainder of REG_A divided by REG_N. The length of the operation is flexible and can be chosen based on the specific requirements of the use case.

REG_R = REG_A % REG_N

Pipeline configuration

The following section describe how the PKA engine is used to accelerate asymmetric cryptographic algorithms.

The PKA engine supports pipelined operations; the pipeline depth is one opcode, thus the next operation can be set up while the previous operation is executing. Register PKA_PIPE will indicate if the pipeline is ready for a new opcode and register PKA_DONE will indicate when the PKA operation has been completed and no operation is waiting in the pipeline.

  1. Enable CRYPTOCELL subsystem as described in Cryptographic flow.
  2. Initialize the PKA engine to accommodate the maximum bit size of all intended operations
    1. Configure registers PKA_L[n] (n=0..7) for all required operand bit sizes. The desired operand length is selected using field LEN in register OPCODE.
    2. Define the PKA SRAM memory map partitioning using register MEMORY_MAP[n] (n=0..31) for register N, Np, T0, and T1, as well as any other virtual registers intended to be used in the operations. The PKA SRAM memory map partitioning must allow for the max operand bit size plus an additional 64 bits reserved for PKA engine internal calculations.
  3. For all operations
    1. Load the PKA SRAM virtual registers N and Np as required
    2. Load the remaining PKA SRAM virtual registers as required
    3. Execute the operation by writing register OPCODE
    4. Prepare the next opcode once register PKA_PIPE is ready.
    5. Handle any status bits in register PKA_STATUS
    6. Re-use intermediate results of the previous operation as needed.
  4. Wait for the operation to complete by either polling register PKA_DONE, or by unmasking the interrupt for field PKA_MASK in register IMR
  5. Read the result from the result register.

PKA SRAM

The 6 kB PKA SRAM memory connected to the PKA engine is used exclusively by the engine during cryptographic operations. All access to this memory is blocked while the PKA engine is processing.

The PKA SRAM memory is not directly mapped to the device memory map. Instead, any read or write operation to this memory region must be done using the PKA engine.

Writing data to the PKA SRAM involves the following steps:

  1. Set the Address Offset: Specify the starting byte address for writing by setting register PKA_SRAM_WADDR. An offset value of 0x0 points to the first 32-bits word in the PKA SRAM memory. An offset value of 0x10 points to the fourth 32-bits word in the PKA SRAM memory.

  2. Write Data: After setting the address offset, data is written to register PKA_SRAM_WDATA. The address will automatically increment after each write, allowing writes to the next word without needing to set the offset again.

Reading data from the PKA SRAM involves the following steps:

  1. Set the Read Address: Specify the starting byte address for reading by setting register PKA_SRAM_RADDR

  2. Read Data: Retrieve the data from register PKA_SRAM_RDATA. Similar to the write address, the read address will auto-increment with each read, setting it to the next word.

Note: Before switching from writing to reading operations (or vice versa), the PKA SRAM write buffer must be cleared. This is done using register PKA_SRAM_WCLEAR. Clearing the buffer ensures that the next operation starts cleanly without any leftover data from the previous operation.

Cryptographic flow

The following section describe a simple cryptographic flow for this engine.


        
        /* Enable CRYPTOCELL and its PKA engine */
        NRF_CRYPTOCELL->ENABLE = CRYPTOCELL_ENABLE_ENABLE_Enabled;
        NRF_CC_MISC->PKA_CLK = CC_MISC_PKA_CLK_ENABLE_Enable;
    
        /* Define the operand bit size as 2048 */
        NRF_CC_PKA->PKA_L[1] = 0x800;
    
        /* Define the 32-bits PKA SRAM address of the selected R4 and R5 */
        NRF_CC_PKA->MEMORY_MAP[4] = 0x108;
        NRF_CC_PKA->MEMORY_MAP[5] = 0x14A;
    
        /* Initialize the SRAM registers with one word of data */
        NRF_CC_PKA->PKA_SRAM_WADDR = NRF_CC_PKA->MEMORY_MAP[4];
        NRF_CC_PKA->PKA_SRAM_WDATA = 0x5;
        NRF_CC_PKA->PKA_SRAM_WADDR = NRF_CC_PKA->MEMORY_MAP[5];
        NRF_CC_PKA->PKA_SRAM_WDATA = 0x2;
    
        /* Execute subtract, OPCODE SubDecNeg: R4 = R4 - R5 */
        NRF_CC_PKA->OPCODE =
            (4 << CC_PKA_OPCODE_REG_R_Pos) |
            (5 << CC_PKA_OPCODE_REG_B_Pos) |
            (4 << CC_PKA_OPCODE_REG_A_Pos) |
            (1 << CC_PKA_OPCODE_LEN_Pos)   |
            (CC_PKA_OPCODE_OPCODE_SubDecNeg << CC_PKA_OPCODE_OPCODE_Pos);
    
        /* Wait for operation to complete, result will be in R4 */
        while (!NRF_CC_PKA->PKA_DONE) { }
        
        

This cryptographic flow example perform a subtract operation with the following assumptions:

  • All PKA SRAM registers, including the special virtual registers N, Np, T0, and T1, have been cleared before the operation is run.
  • The operation is using index 1 in register PKA_L[n] (n=0..7), which is set to accommodate an operand size of 2048 bits.
  • Register R4 and R5 have been selected to run this operation. Register R4 is used both as the operand A register and the result register.
  • The memory map is configured to allow operands of 2048 bits plus an additional 64 bits for the internal PKA engine calculations. The configuration of the MEMORY_MAP[n] (n=0..31) for virtual register N, Np, T0, and T1 is not included in the example. The memory map is thus configured with 66 words per register, leading to the following:
Virtual registerMemory map registerPKA SRAM address
N (R0)MEMORY_MAP[0]0x0
Np (R1)MEMORY_MAP[1]0x42
.........
R4MEMORY_MAP[4]0x108
R5MEMORY_MAP[5]0x14A
.........

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_PKAAPPLICATION0x50845000HFSNSANoCRYPTOCELL PKA engine
Register overview
RegisterOffsetTZDescription
MEMORY_MAP[n]0x0Register for mapping the virtual register R[n] to a physical address in the PKA SRAM.
OPCODE0x80

Operation code to be executed by the PKA engine.

Writing to this register triggers the PKA operation.

N_NP_T0_T1_ADDR0x84This register defines the N, Np, T0, and T1 virtual register index.
PKA_STATUS0x88This register holds the status for the PKA pipeline.
PKA_SW_RESET0x8CReset the PKA engine.
PKA_L[n]0x90This register holds the operands bit size.
PKA_PIPE0xB0Status register indicating if the PKA pipeline is ready to receive a new OPCODE.
PKA_DONE0xB4Status register indicating if the PKA operation has been completed.
PKA_VERSION0xC4PKA engine HW version. Reset value holds the version.
PKA_SRAM_WADDR0xD4Start address in PKA SRAM for subsequent write transactions.
PKA_SRAM_WDATA0xD8Write data to PKA SRAM. Writing to this register triggers a DMA transaction writing data into PKA SRAM. The DMA address offset is automatically incremented during write.
PKA_SRAM_RDATA0xDCRead data from PKA SRAM. Reading from this register triggers a DMA transaction read data from PKA SRAM. The DMA address offset is automatically incremented during read.
PKA_SRAM_WCLEAR0xE0Register for clearing PKA SRAM write buffer.
PKA_SRAM_RADDR0xE4Start address in PKA SRAM for subsequent read transactions.
MEMORY_MAP[n] (n=0..31)

Address offset: 0x0 + (n × 0x4)

Register for mapping the virtual register R[n] to a physical address in the PKA SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWADDRThe physical word address used for the virtual register.
OPCODE

Address offset: 0x80

Operation code to be executed by the PKA engine.

Writing to this register triggers the PKA operation.

Bit number313029282726252423222120191817161514131211109876543210
IDIIIIIHHHGFFFFFEDDDDDCBBBBBAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWTAGHolds the operation tag or the operand C virtual register index.
BRWREG_RResult register virtual register index.
CRWDISCARD_RThis field controls the interpretation of REG_R.
Register0x0REG_R is intepreted as a register index.
Discard0x1Result is discarded.
DRWREG_BOperand B virtual register index.
ERWCONST_BThis field controls the interpretation of REG_B.
Register0x0REG_B is intepreted as a register index.
Constant0x1REG_B is intepreted as a constant.
FRWREG_AOperand A virtual register index.
GRWCONST_AThis field controls the interpretation of REG_A.
Register0x0REG_A is intepreted as a register index.
Constant0x1REG_A is intepreted as a constant.
HRWLENThe length of the operands. This value serves as an PKA length register index. E.g.: if LEN field value is set to 0, PKA_L[0] holds the size of the operands.
IRWOPCODEOperation code to be executed by the PKA engine
Terminate0x0Terminate operation
AddInc0x4Add or Increment
SubDecNeg0x5Subtract, Decrement, or Negate
ModAddInc0x6Modular Add or Modular Increment
ModSubDecNeg0x7Modular Subtract, Modular Decrement, or Modular Negate
ANDTST0CLR00x8Perform AND, test, or clear
ORCOPYSET00x9Perform OR, copy, or set bits
XORFLP0INVCMP0xAPerform XOR, flip bits, invert, or compare
SHR00xCShift right 0 operation
SHR10xDShift right 1 operation
SHL00xEShift left 0 operation
SHL10xFShift left 1 operation
MulLow0x10Multiply low operation
ModMul0x11Modular multiply operation
ModMulN0x12Modular multiply N operation
ModExp0x13Modular exponentiation operation
Division0x14Division operation
ModInv0x15Modular inversion operation
ModDiv0x16Modular division operation
MulHigh0x17Multiply high operation
ModMLAC0x18Modular multiplication acceleration
ModMLACNR0x19Modular multiplication acceleration where final reduction is omitted
Reduction0x1BReduction operation
N_NP_T0_T1_ADDR

Address offset: 0x84

This register defines the N, Np, T0, and T1 virtual register index.

Bit number313029282726252423222120191817161514131211109876543210
IDDDDDDCCCCCBBBBBAAAAA
Reset 0x000FF82000000000000011111111100000100000
IDR/WFieldValue IDValueDescription
ARWN_VIRTUAL_ADDRRegister N virtual register index. Default is R0.
BRWNP_VIRTUAL_ADDRRegister Np virtual register index. Default is R1.
CRWT0_VIRTUAL_ADDRTemporary register 0 virtual register index. Default is R30.
DRWT1_VIRTUAL_ADDRTemporary register 1 virtual register index. Default is R31.
PKA_STATUS

Address offset: 0x88

This register holds the status for the PKA pipeline.

Bit number313029282726252423222120191817161514131211109876543210
IDKKKKKJIHGFEDCBBBBAAAA
Reset 0x0000100000000000000000000001000000000000
IDR/WFieldValue IDValueDescription
ARALU_MSB_4BITSThe most significant 4-bits of the operand updated in shift operation.
BRALU_LSB_4BITSThe least significant 4-bits of the operand updated in shift operation.
CRALU_SIGN_OUTIndicates the MSB sign of the last operation.
DRALU_CARRYHolds the carry of the last ALU operation.
ERALU_CARRY_MODHolds the carry of the last modular operation.
FRALU_SUB_IS_ZEROIndicates the last subtraction operation sign.
GRALU_OUT_ZEROIndicates if the result of ALU OUT is zero.
HRALU_MODOVRFLWModular overflow flag.
IRDIV_BY_ZEROIndication if the division is done by zero.
JRMODINV_OF_ZEROIndicates the modular inverse of zero.
KROPCODEOpcode of the last operation
PKA_SW_RESET

Address offset: 0x8C

Reset the PKA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the PKA engine. The reset takes 4 CPU clock cycles to complete.
Enable1Reset PKA engine.
PKA_L[n] (n=0..7)

Address offset: 0x90 + (n × 0x4)

This register holds the operands bit size.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWOpSizeOperand bit size.
PKA_PIPE

Address offset: 0xB0

Status register indicating if the PKA pipeline is ready to receive a new OPCODE.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARSTATUSPKA pipeline status.
NotReady0PKA pipeline is not ready for a new OPCODE
Ready1PKA pipeline is ready for a new OPCODE
PKA_DONE

Address offset: 0xB4

Status register indicating if the PKA operation has been completed.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARSTATUSPKA operation status.
Processing0PKA operation is processing
Completed1PKA operation is completed and pipeline is empty
PKA_VERSION

Address offset: 0xC4

PKA engine HW version. Reset value holds the version.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x1611021500010110000100010000001000010101
IDR/WFieldValue IDValueDescription
ARPKA_VERSION
PKA_SRAM_WADDR

Address offset: 0xD4

Start address in PKA SRAM for subsequent write transactions.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWADDRPKA SRAM start address for write transaction
PKA_SRAM_WDATA

Address offset: 0xD8

Write data to PKA SRAM. Writing to this register triggers a DMA transaction writing data into PKA SRAM. The DMA address offset is automatically incremented during write.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWDATAData to write to PKA SRAM.
PKA_SRAM_RDATA

Address offset: 0xDC

Read data from PKA SRAM. Reading from this register triggers a DMA transaction read data from PKA SRAM. The DMA address offset is automatically incremented during read.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARDATAData to read from PKA SRAM
PKA_SRAM_WCLEAR

Address offset: 0xE0

Register for clearing PKA SRAM write buffer.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWCLEARClear the PKA SRAM write buffer.
PKA_SRAM_RADDR

Address offset: 0xE4

Start address in PKA SRAM for subsequent read transactions.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWADDRPKA SRAM start address for read transaction

RNG engine

CRYPTOCELL implements a Random Number Generator (RNG) engine which uses a True Random Number Generator (TRNG) for its entropy collection.

The TRNG is a full entropy design compliant with:
  • FIPS 140-2: Security requirements for Cryptographic Modules
  • BSI AIS-31: Functionality Classes and Evaluation Methodology for True Random Number Generators
  • NIST SP 800-90B: Recommendation for the Entropy Sources Used for Random Bit Generation
where a ring-oscillator is used as the noise source.

The entropy collected using the RNG engine can in turn be used for seeding a Pseudo Random Number Generator (PRNG) as defined in NIST SP 800-90A: Recommendation for Random Number Generation Using Deterministic Random Bit Generators.

NIST SP 800-90A define three Deterministic Random Bit Generator (DRBG) that are considered cryptographically secure pseudorandom number generators for use in cryptography: Hash DRBG, HMAC DRBG, and CTR DRBG.

The CRYPTOCELL DRBG implementation is a combination of hardware and software, where CTR DRBG is implemented using the the AES engine running AES encryption in counter (CTR) mode as the underlying cipher. This DRBG instance is seeded with random entropy from the RNG engine.

Ring oscillator length configuration

The RNG engine must be configured with specific parameters to ensure correct operation in order to output random bits with sufficient entropy.

The noise source used for collecting entropy is based on inverter timing jitter that is collected from a dedicated on-chip free-running ring oscillator. The ring oscillator length, i.e. the number of inverters in the chain, can be configured using register TRNG_CONFIG.

In total there are four different ring oscillator lengths that can be selected, referred to as ROSC1 through ROSC4. For each of these four configurable lengths a corresponding sample count value is provided in register TRNG90B.ROSC1 through register TRNG90B.ROSC4.

The sampling frequency is configured using register SAMPLE_CNT, and the programmed value defines the number of CPU clock cycles between two consecutive ring oscillator samples. The configured sample count value is the minimum number of clock cycles that is enough to get independent outputs from the ring oscillator and must match that of the configured ROSC length.

The following steps describe how to set the RNG engine parameters described above:
  1. Enable RNG engine clock using register RNG_CLK.
  2. Reset the RNG engine using register RNG_SW_RESET.
  3. Re-enable RNG engine clock and select a device-specific sample count from registers TRNG90B.ROSC1 through TRNG90B.ROSC4 starting with the smallest one, and program the value into register SAMPLE_CNT.
  4. Perform a readback of the selected sample count value.
  5. Set the corresponding ROSC length in register TRNG_CONFIG to match the selected sample count selection.
  6. Enable the noise source using register NOISE_SOURCE.
  7. Wait until event EHR_VALID_INT in register RNG_ISR trigger to indicate successful collection of 192 bits of random data. The result can be read from registers EHR_DATA[n] (n=0..5).
  8. If events AUTOCORR_ERR_INT, CRNGT_ERR_INT, or VNC_ERR_INT in register RNG_ISR trigger, the RNG engine must be re-configured starting from step 2 above. Increase the ROSC length by a factor of one, and pick the corresponding sample count value from FICR. This step must be repeated until the collection of 192 bits of random data can be collected without an error event being triggered.

It is recommended to always try the shortest ROSC length first, allowing the RNG engine to complete the entropy collection in a shorter time and keep the ring oscillator turned off for longer periods in order to save power.

RNG SRAM

The 2 kB SRAM memory connected to the RNG engine can be used for storing a large pool of random entropy.

The RNG SRAM memory is not directly mapped to the device memory map. Instead, any read or write operation using word granularity to this memory region must be done using RNG SRAM interface. Larger payloads than word granularity can be processed using the DIN DMA engine and DOUT DMA engine.

Before any RNG SRAM read or write transaction can be performed, the CRYPTOCELL must be enabled.

Writing data to the RNG SRAM involves the following steps:

  1. Set the Address Offset: Specify the starting byte address for writing by setting register SRAM_ADDR. An offset value of 0x0 points to the first 32-bits word in the RNG SRAM memory. An offset value of 0x10 points to the fourth 32-bits word in the RNG SRAM memory.

  2. Write Data: When register SRAM_DATA_READY indicates DMA engine is idle, data is written to register SRAM_DATA. The address will automatically increment after each write, allowing writes to the next word without needing to set the offset again.

Reading data from the RNG SRAM involves the following steps:

  1. Set the Read Address: Specify the starting byte address for reading by setting register SRAM_ADDR

  2. Discard first read: Read and discard the first value from register SRAM_DATA, as it will contain the previous value pointed to by register SRAM_ADDR.

  3. Read Data: When register SRAM_DATA_READY indicates DMA engine is idle, retrieve the data from register SRAM_DATA. Similar to the write address, the read address will auto-increment with each read, setting it to the next word.

Note: Once the address register reaches the last RNG SRAM address, the automatic address incrementation halts. Any subsequent read or write transaction will cause the DMA engine to continue operating on the last 32-bits word in the RNG SRAM memory.

TRNG hardware tests

The RNG engine has a number of built-in hardware tests for making sure the collected entropy from the TRNG is of sufficient quality.

Figure 4. CRYPTOCELL True Random Number Generator
CRYPTOCELL True Random Number Generator

The TRNG collects random bits from the noise source according to the programmed sample counter value in register SAMPLE_CNT. The sampled bits are post-processed in a von Neumann corrector (VNC) before being subjected to a continuous random number generation test (CRNGT) and autocorrelation test.

192 bits of random data can be read from the entropy holding registers EHR_DATA[n] (n=0..5) once interrupt EHR_VALID_INT in register RNG_ISR trigger. If this interrupt is masked away in register RNG_IMR, the status register TRNG_VALID contains field EHR_DATA which can be polled when the random data is valid. Reading the most significant word from EHR_DATA registers will reset register TRNG_VALID and a new 192 bits collection period will start.

Note:
To ensure proper operation when reading 192 bits of random data from the EHR_DATA registers of the RNG engine the data must be read in ascending order, starting with:

von Neumann Corrector

The von Neumann Corrector (VNC) is designed to balance the succession of '1' and '0' bits being output by the TRNG noise source.

The input bits to the VNC is tested for bit equality, meaning a sequence of 32 consequtive bits with the same bit value will trigger event VNC_ERR_INT in register RNG_ISR.

If no error event is triggered, the input bits will be balanced using the VNC as shown in the figure below, and the resulting output bits will be subjected to additional TRNG tests. The VNC produce output only if the noise source is active, see register NOISE_SOURCE.

Figure 5. CRYPTOCELL von Neumann corrector
CRYPTOCELL von Neumann corrector

The VNC statistically output one bit for each 4 input bits sampled, meaning the average output rate of the TRNG is 1/(SAMPLE_CNT * 4) bits per CPU clock cycle.

Continuous random number generation test

The Continuous random number generation test (CRNGT) process the balanced output of random data from the von Neumann corrector.

In the event that two consecutive blocks of 16 collected bits are equal, the CRNGT will trigger event CRNGT_ERR_INT in register RNG_ISR.

Autocorrelation test

The Autocorrelation test determine if there over time is a bias in the random bit sequences towards certain values or patterns, or if the bits in the sequence are truly independent.

If a bias in the collected bit stream is detected, the output will be discarded and the error flagged in register AUTOCORR_STATISTIC. If a bias is detected four consecutive times in a row, the autocorrelation test will trigger event AUTOCORR_ERR_INT in register RNG_ISR. In this situation the TRNG will cease to function until manually reset using register RNG_SW_RESET.

Cryptographic flow

The following section describe a simple cryptographic flow for this engine.


    
    /* Enable CRYPTOCELL subsystem */
    NRF_CRYPTOCELL->ENABLE = CRYPTOCELL_ENABLE_ENABLE_Enabled;

    /* Enable engine clock */
    NRF_CC_RNG->RNG_CLK = CC_RNG_RNG_CLK_ENABLE_Enable;

    /* Reset engine */
    NRF_CC_RNG->RNG_SW_RESET = CC_RNG_RNG_SW_RESET_RESET_Enable;

    /* Configure sampling rate between consecutive bits */
    do { 
        NRF_CC_RNG->RNG_CLK = CC_RNG_RNG_CLK_ENABLE_Enable;     
        NRF_CC_RNG->SAMPLE_CNT = NRF_FICR->TRNG90B.ROSC1;
    } while ( NRF_CC_RNG->SAMPLE_CNT != NRF_FICR->TRNG90B.ROSC1 );

    /* Configure ROSC length */
    NRF_CC_RNG->TRNG_CONFIG = CC_RNG_TRNG_CONFIG_ROSC_LEN_ROSC1;

    /* Enable noise source */
    NRF_CC_RNG->NOISE_SOURCE = CC_RNG_NOISE_SOURCE_ENABLE_Enabled;

    /* Wait for random data to be sampled */
    while ((NRF_CC_RNG->RNG_ISR & CC_RNG_RNG_ISR_EHR_VALID_INT_Msk) == 0) {}

    /* 192 bits of random data now available in
       NRF_CC_RNG->EHR_DATA[0] to NRF_CC_RNG->EHR_DATA[5] */
    
    

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_RNGAPPLICATION0x50845000HFSNSANoCRYPTOCELL RNG engine
Register overview
RegisterOffsetTZDescription
RNG_IMR0x100Interrupt mask register. Each bit of this register holds the mask of a single interrupt source.
RNG_ISR0x104Interrupt status register. Each bit of this register holds the interrupt status of a single interrupt source. If corresponding RNG_IMR bit is unmasked, an interrupt is generated.
RNG_ICR0x108Interrupt clear register. Writing a 1 bit into a field in this register will clear the corresponding bit in RNG_ISR.
TRNG_CONFIG0x10CTRNG ring oscillator length configuration
TRNG_VALID0x110This register indicates if TRNG entropy collection is valid.
EHR_DATA[n]0x114

The entropy holding registers (EHR) hold 192-bits random data collected by the TRNG.

The initial EHR_DATA[0] register holds the least significant bits [31:0] of the random data value.

NOISE_SOURCE0x12CThis register controls the ring oscillator circuit used as a noise source.
SAMPLE_CNT0x130Sample count defining the number of CPU clock cycles between two consecutive noise source samples.
AUTOCORR_STATISTIC0x134Statistics counter for autocorrelation test activations. Statistics collection is stopped if one of the counters reach its limit of all ones.
TRNG_DEBUG0x138Debug register for the TRNG. This register is used to bypass TRNG tests in hardware.
RNG_SW_RESET0x140Reset the RNG engine.
RNG_BUSY0x1B8Status register for RNG engine activity.
TRNG_RESET0x1BCReset the TRNG, including internal counter of collected bits and registers EHR_DATA and TRNG_VALID.
RNG_HW_FLAGS0x1C0Hardware configuration of RNG engine. Reset value holds the supported features.
RNG_CLK0x1C4Control clock for the RNG engine.
RNG_DMA0x1C8Writing to this register enables the RNG DMA engine.
RNG_DMA_ROSC_LEN0x1CCThis register defines which ring oscillator length configuration should be used when using the RNG DMA engine.
RNG_DMA_SRAM_ADDR0x1D0This register defines the start address in TRNG SRAM for the TRNG data to be collected by the RNG DMA engine.
RNG_DMA_SAMPLES_NUM0x1D4This register defines the number of 192-bits samples that the RNG DMA engine collects per run.
RNG_WATCHDOG_VAL0x1D8This register defines the maximum number of CPU clock cycles per TRNG collection of 192-bits samples. If the number of cycles for a collection exceeds this threshold the WATCHDOG interrupt is triggered.
RNG_DMA_BUSY0x1DCStatus register for RNG DMA engine activity.
RNG_IMR

Address offset: 0x100

Interrupt mask register. Each bit of this register holds the mask of a single interrupt source.

Bit number313029282726252423222120191817161514131211109876543210
IDFEDCBA
Reset 0x0000003F00000000000000000000000000111111
IDR/WFieldValue IDValueDescription
ARWEHR_VALID_MASKSee RNG_ISR for explanation on this interrupt.
IRQEnable0Do not mask EHR interrupt i.e. interrupt is generated
IRQDisable1Mask EHR interrupt i.e. no interrupt is generated
BRWAUTOCORR_ERR_MASKSee RNG_ISR for explanation on this interrupt.
IRQEnable0Do not mask autocorrelation interrupt i.e. interrupt is generated
IRQDisable1Mask autocorrelation interrupt i.e. no interrupt is generated
CRWCRNGT_ERR_MASKSee RNG_ISR for explanation on this interrupt.
IRQEnable0Do not mask the CRNGT error interrupt i.e. interrupt is generated
IRQDisable1Mask the CRNGT error interrupt i.e. no interrupt is generated
DRWVNC_ERR_MASKSee RNG_ISR for explanation on this interrupt.
IRQEnable0Do not mask the von Neumann corrector error interrupt i.e. interrupt is generated
IRQDisable1Mask the von Neumann corrector error interrupt i.e. no interrupt is generated
ERWWATCHDOG_MASKSee RNG_ISR for explanation on this interrupt.
IRQEnable0Do not mask the watchdog interrupt i.e. interrupt is generated
IRQDisable1Mask the watchdog interrupt i.e. no interrupt is generated
FRWDMA_DONE_MASKSee RNG_ISR for explanation on this interrupt.
IRQEnable0Do not mask the RNG DMA completion interrupt i.e. interrupt is generated
IRQDisable1Mask the RNG DMA completion interrupt i.e. no interrupt is generated
RNG_ISR

Address offset: 0x104

Interrupt status register. Each bit of this register holds the interrupt status of a single interrupt source. If corresponding RNG_IMR bit is unmasked, an interrupt is generated.

Bit number313029282726252423222120191817161514131211109876543210
IDFEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AREHR_VALID_INT192-bits have been collected and are ready to be read.
BRAUTOCORR_ERR_INTAutocorrelation error. Failure occurs when autocorrelation test has failed four times in a row. Once set, the TRNG ceases to function until next reset.
CRCRNGT_ERR_INTContinuous random number generator test error. Failure occurs when two consecutive blocks of 16 collected bits are equal.
DRVNC_ERR_INTvon Neumann corrector error. Failure occurs if 32 consecutive collected bits are identical, ZERO, or ONE.
ERWATCHDOG_INTMaximum number of CPU clock cycles per sample have been exceeded. See RNG_WATCHDOG_VAL for more information.
FRDMA_DONE_INTRNG DMA to SRAM is completed.
RNG_ICR

Address offset: 0x108

Interrupt clear register. Writing a 1 bit into a field in this register will clear the corresponding bit in RNG_ISR.

Bit number313029282726252423222120191817161514131211109876543210
IDFEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWEHR_VALID_CLEARWriting value '1' clears corresponding bit in RNG_ISR
BWAUTOCORR_ERR_CLEARCannot be cleared by software! Only RNG reset clears this bit.
CWCRNGT_ERR_CLEARWriting value '1' clears corresponding bit in RNG_ISR
DWVNC_ERR_CLEARWriting value '1' clears corresponding bit in RNG_ISR
EWWATCHDOG_CLEARWriting value '1' clears corresponding bit in RNG_ISR
FWDMA_DONE_CLEARWriting value '1' clears corresponding bit in RNG_ISR
TRNG_CONFIG

Address offset: 0x10C

TRNG ring oscillator length configuration

Bit number313029282726252423222120191817161514131211109876543210
IDAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWROSC_LENSet the length of the oscillator ring (= the number of inverters) out of four possible configurations.
ROSC10Use shortest ROSC1 ring oscillator configuration.
ROSC21Use ROSC2 ring oscillator configuration.
ROSC32Use ROSC3 ring oscillator configuration.
ROSC43Use longest ROSC4 ring oscillator configuration.
TRNG_VALID

Address offset: 0x110

This register indicates if TRNG entropy collection is valid.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AREHR_DATAA value of 1 indicates that collection of bits in the TRNG is completed, and data can be read from EHR_DATA registers.
NotValid0Collection of bits not valid.
Valid1Collection of bits valid.
EHR_DATA[n] (n=0..5)

Address offset: 0x114 + (n × 0x4)

The entropy holding registers (EHR) hold 192-bits random data collected by the TRNG.

The initial EHR_DATA[0] register holds the least significant bits [31:0] of the random data value.

These registers are readable if register TRNG_VALID is Valid. Reading register EHR_DATA[5] will clear the content, reset TRNG_VALID, and start a new 192 bits collection period.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARVALUERandom data value.
NOISE_SOURCE

Address offset: 0x12C

This register controls the ring oscillator circuit used as a noise source.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENABLEEnable or disable the noise source.
Disabled0Noise source is disabled
Enabled1Noise source is enabled
SAMPLE_CNT

Address offset: 0x130

Sample count defining the number of CPU clock cycles between two consecutive noise source samples.

After selecting the desired ring oscillator length configuration in TRNG_CONFIG this register must be set to the corresponding value from FICR.TRNG90B.ROSC1-4.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000FFFF00000000000000001111111111111111
IDR/WFieldValue IDValueDescription
ARWVALUE

Number of CPU clock cycles between two consecutive noise source samples.

If the von Neumann corrector is bypassed, the minimum value set in this register must not be smaller than decimal 17.

AUTOCORR_STATISTIC

Address offset: 0x134

Statistics counter for autocorrelation test activations. Statistics collection is stopped if one of the counters reach its limit of all ones.

Bit number313029282726252423222120191817161514131211109876543210
IDBBBBBBBBAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWAUTOCORR_TRYSCount each time an autocorrelation test starts. Any write to the field resets the counter.
BRWAUTOCORR_FAILSCount each time an autocorrelation test fails. Any write to the field resets the counter.
TRNG_DEBUG

Address offset: 0x138

Debug register for the TRNG. This register is used to bypass TRNG tests in hardware.

Bit number313029282726252423222120191817161514131211109876543210
IDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWVNC_BYPASSBypass the von Neumann corrector post-processing test, including the 32 consecutive bits test.
Disabled0von Neumann corrector post-processing is active
Enabled1Bypass the von Neumann corrector
BRWCRNGT_BYPASSBypass the Continuous Random Number Generator Test (CRNGT).
Disabled0CRNGT is active
Enabled1Bypass CRNGT
CRWAUTOCORR_BYPASSBypass the autocorrelation test.
Disabled0Autocorrelation test is active
Enabled1Bypass the autocorrelation test
RNG_SW_RESET

Address offset: 0x140

Reset the RNG engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the RNG engine. The reset takes 4 CPU clock cycles to complete.
Enable1Reset RNG engine.
RNG_BUSY

Address offset: 0x1B8

Status register for RNG engine activity.

Bit number313029282726252423222120191817161514131211109876543210
IDBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSRNG engine status.
Idle0RNG engine is idle
Busy1RNG engine is busy
BRTRNG_STATUSTRNG status.
Idle0TRNG is idle
Busy1TRNG is busy
TRNG_RESET

Address offset: 0x1BC

Reset the TRNG, including internal counter of collected bits and registers EHR_DATA and TRNG_VALID.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the internal bits counter and registers EHR_DATA and TRNG_VALID. Register NOISE_SOURCE must be disabled in order for the reset to take place.
Enable1Reset TRNG.
RNG_HW_FLAGS

Address offset: 0x1C0

Hardware configuration of RNG engine. Reset value holds the supported features.

Bit number313029282726252423222120191817161514131211109876543210
IDHGFEDCBA
Reset 0x0000000F00000000000000000000000000001111
IDR/WFieldValue IDValueDescription
AREHR_WIDTHData width supported by the entropy collector
128Bits0128 bits EHR width
192Bits1192 bits EHR width
BRCRNGT_EXISTSIf this flag is set, the engine include support for continuous random number generator test.
CRAUTOCORR_EXISTSIf this flag is set, the engine include support for autocorrelation test.
DRBYPASS_EXISTSIf this flag is set, the engine include support for bypassing TRNG tests.
ERPRNG_EXISTSIf this flag is set, the engine include a pseudo-random number generator.
FRKAT_EXISTSIf this flag is set, the engine include support for known answer tests.
GRRESEEDING_EXISTSIf this flag is set, the engine include support for automatic reseeding.
HRRNG_USE_5_SBOXES
Disable020 SBOX AES
Enable15 SBOX AES
RNG_CLK

Address offset: 0x1C4

Control clock for the RNG engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEEnables clock for the RNG engine.
Disable0Disable clock for RNG engine.
Enable1Enable clock for RNG engine.
RNG_DMA

Address offset: 0x1C8

Writing to this register enables the RNG DMA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENABLE
Disable0Disable RNG DMA engine
Enable1

Enable RNG DMA engine

This value is cleared when the RNG DMA engine completes its operation.

RNG_DMA_ROSC_LEN

Address offset: 0x1CC

This register defines which ring oscillator length configuration should be used when using the RNG DMA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWROSC1Use shortest ROSC1 ring oscillator configuration.
Disable0Disable ROSC1
Enable1Enable ROSC1
BRWROSC2Use ROSC2 ring oscillator configuration.
Disable0Disable ROSC2
Enable1Enable ROSC2
CRWROSC3Use ROSC3 ring oscillator configuration.
Disable0Disable ROSC3
Enable1Enable ROSC3
DRWROSC4Use longest ROSC4 ring oscillator configuration.
Disable0Disable ROSC4
Enable1Enable ROSC4
RNG_DMA_SRAM_ADDR

Address offset: 0x1D0

This register defines the start address in TRNG SRAM for the TRNG data to be collected by the RNG DMA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWRNG_SRAM_DMA_ADDRStart address of the TRNG data in TRNG SRAM.
RNG_DMA_SAMPLES_NUM

Address offset: 0x1D4

This register defines the number of 192-bits samples that the RNG DMA engine collects per run.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWRNG_SAMPLES_NUMDefines the number of 192-bits samples that the DMA engine collects per run.
RNG_WATCHDOG_VAL

Address offset: 0x1D8

This register defines the maximum number of CPU clock cycles per TRNG collection of 192-bits samples. If the number of cycles for a collection exceeds this threshold the WATCHDOG interrupt is triggered.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWRNG_WATCHDOG_VALDefines the maximum number of CPU clock cycles per TRNG collection of 192-bits samples. If the number of cycles for a collection exceeds this threshold the WATCHDOG interrupt is triggered.
RNG_DMA_BUSY

Address offset: 0x1DC

Status register for RNG DMA engine activity.

Bit number313029282726252423222120191817161514131211109876543210
IDCCCCCCCCBBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSRNG DMA engine status.
Idle0RNG DMA engine is idle
Busy1RNG DMA engine is busy
BRROSC_LENThe active ring oscillator length configuration used by the RNG DMA engine.
ROSC10Shortest ROSC1 ring oscillator configuration used.
ROSC21ROSC2 ring oscillator configuration used.
ROSC32ROSC3 ring oscillator configuration used.
ROSC43Longest ROSC4 ring oscillator configuration used.
CRNUM_OF_SAMPLESNumber of samples already collected using the current ring oscillator configuration.

Host integration

This chapter describes host registers used to control CRYPTOCELL behavior.

AHB interface

The AHB interface controls CRYPTOCELL bus master behavior.

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_AHBAPPLICATION0x50845000HFSNSANoCRYPTOCELL AHB interface
Register overview
RegisterOffsetTZDescription
AHBM_SINGLES0xB00This register forces the AHB transactions from CRYPTOCELL master to be always singles.
AHBM_HPROT0xB04This register holds the AHB HPROT value
AHBM_HMASTLOCK0xB08This register holds AHB HMASTLOCK value
AHBM_HNONSEC0xB0CThis register holds AHB HNONSEC value
AHBM_SINGLES

Address offset: 0xB00

This register forces the AHB transactions from CRYPTOCELL master to be always singles.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWAHB_SINGLESForce AHB singles
AHBM_HPROT

Address offset: 0xB04

This register holds the AHB HPROT value

Bit number313029282726252423222120191817161514131211109876543210
IDAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWAHB_HPROTThe AHB HPROT value
AHBM_HMASTLOCK

Address offset: 0xB08

This register holds AHB HMASTLOCK value

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWAHB_HMASTLOCKThe AHB HMASTLOCK value.
AHBM_HNONSEC

Address offset: 0xB0C

This register holds AHB HNONSEC value

Bit number313029282726252423222120191817161514131211109876543210
IDBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWAHB_WRITE_HNONSECThe AHB HNONSEC value for write transaction.
BRWAHB_READ_HNONSECThe AHB HNONSEC value for read transaction.

AO interface

The always-on (AO) interface controls various persistent security configurations for the CRYPTOCELL subsystem.

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_AOAPPLICATION0x50845000HFSNSANoCRYPTOCELL AO block
Register overview
RegisterOffsetTZDescription
AO_APB_FILTERING0xE38This register holds the AO_APB_FILTERING configuration.
CC_SW_RESET0xE40Reset the CRYPTOCELL subsystem.
AO_APB_FILTERING

Address offset: 0xE38

This register holds the AO_APB_FILTERING configuration.

Bit number313029282726252423222120191817161514131211109876543210
IDDCBA
Reset 0x0000005500000000000000000000000001010101
IDR/WFieldValue IDValueDescription
ARWONLY_SEC_ACCESS_ALLOWEDWhen this FW controlled field is set, the APB slave accepts only secure accesses
BRWONLY_SEC_ACCESS_ALLOWED_LOCKWhen this FW controlled field is set, the ONLY_SEC_ACCESS_ALLOWED field cannot be modified until the next PoR
CRWONLY_PRIV_ACCESS_ALLOWEDWhen this FW controlled field is set, the APB slave accepts only privileged accesses
DRWONLY_PRIV_ACCESS_ALLOWED_LOCKWhen this FW controlled field is set, the APBC_ONLY_PRIV_ACCESS_ALLOWED field cannot be modified until the next PoR
CC_SW_RESET

Address offset: 0xE40

Reset the CRYPTOCELL subsystem.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the CRYPTOCELL subsystem. The reset takes 4 CPU clock cycles to complete.
Enable1Reset CRYPTOCELL subsystem.

CTL interface

The CTL interface controls the cryptographic flow and provide busy status for individual components in the CRYPTOCELL subsystem.

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_CTLAPPLICATION0x50845000HFSNSANoCRYPTOCELL CTL interface
Register overview
RegisterOffsetTZDescription
CRYPTO_CTL0x900Defines the cryptographic flow.
CRYPTO_BUSY0x910Status register for cryptographic cores engine activity.
HASH_BUSY0x91CStatus register for HASH engine activity.
CONTEXT_ID0x930A general-purpose read/write register.
CRYPTO_CTL

Address offset: 0x900

Defines the cryptographic flow.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWMODE

Configure the cryptographic engine mode.

The HASH engine is determined by register HASH_SELECT.

Bypass0Bypass cryptographic engine
AESActive1Use AES engine
AESToHashActive2Pipe AES engine output to HASH engine input
AESAndHashActive3Process input using both AES and HASH engine in parallell
HashActive7Use HASH engine
AESMACAndBypassActive9Calculate AES MAC and bypass
AESToHashAndDOUTActive10Pipe AES engine output to HASH engine input. The resulting digest output is piped to DOUT buffer.
ChaChaActive16Use CHACHA engine
CRYPTO_BUSY

Address offset: 0x910

Status register for cryptographic cores engine activity.

This register will be asserted whenever register AES_BUSY or register HASH_BUSY is asserted or when register DIN_FIFO_EMPTY indicate that the DIN FIFO is not empty.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSCryptographic core engines status.
Idle0Cryptographic core engines are idle
Busy1Cryptographic core engines are busy
HASH_BUSY

Address offset: 0x91C

Status register for HASH engine activity.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSHash engine status.
Idle0HASH engine is idle
Busy1HASH engine is busy
CONTEXT_ID

Address offset: 0x930

A general-purpose read/write register.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWCONTEXT_IDContext ID

DIN DMA engine

The Data IN (DIN) DMA engine transfers data into the CRYPTOCELL subsystem and its various cryptographic engines.

The DIN DMA engine provides a comprehensive interface for to facilitate the transfer of data from the CPU or memory to the cryptographic engines. It includes a variety of registers that control direct data buffering, DMA operations, and data flow management.

Maximum DMA transaction size is limited to 216-1 bytes. If a DMA transaction is configured with a payload size above the maximum DMA transaction size limit, the DMA engine must be reset before being functional again using register DIN_SW_RESET.

The flow demonstrated in Cryptographic flow shows how the DIN DMA engine is configured to provide data to the AES engine using registers SRC_MEM_ADDR and SRC_MEM_SIZE to define the input source address and number of input bytes, respectively.

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_DINAPPLICATION0x50845000HFSNSANoCRYPTOCELL DIN DMA engine
Register overview
RegisterOffsetTZDescription
DIN_BUFFER0xC00Used by CPU to write data directly to the DIN buffer, which is then sent to the cryptographic engines for processing.
DIN_DMA_MEM_BUSY0xC20Status register for DIN DMA engine activity when accessing memory.
SRC_MEM_ADDR0xC28Data source address in memory.
SRC_MEM_SIZE0xC2CThe number of bytes to be read from memory. Writing to this register triggers the DMA operation.
SRC_SRAM_ADDR0xC30Data source address in RNG SRAM.
SRC_SRAM_SIZE0xC34The number of bytes to be read from RNG SRAM. Writing to this register triggers the DMA operation.
DIN_DMA_SRAM_BUSY0xC38Status register for DIN DMA engine activity when accessing RNG SRAM.
DIN_DMA_SRAM_ENDIANNESS0xC3CConfigure the endianness of DIN DMA transactions towards RNG SRAM.
DIN_SW_RESET0xC44Reset the DIN DMA engine.
DIN_CPU_DATA0xC48Specifies the number of bytes the CPU will write to the DIN_BUFFER, ensuring the cryptographic engine processes the correct amount of data.
DIN_WRITE_ALIGN0xC4CIndicates that the next CPU write to the DIN_BUFFER is the last in the sequence. This is needed only when the data size is NOT modulo 4 (e.g. HASH padding).
DIN_FIFO_EMPTY0xC50Register indicating if DIN FIFO is empty and if more data can be accepted.
DIN_FIFO_RESET0xC58Reset the DIN FIFO, effectively clearing the FIFO for new data.
DIN_BUFFER

Address offset: 0xC00

Used by CPU to write data directly to the DIN buffer, which is then sent to the cryptographic engines for processing.

The number of bytes to write is defined in DIN_CPU_DATA.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWDATAThis register is mapped into 8 addresses in order to enable a CPU burst.
DIN_DMA_MEM_BUSY

Address offset: 0xC20

Status register for DIN DMA engine activity when accessing memory.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSDIN memory DMA engine status.
Idle0DIN memory DMA engine is idle
Busy1DIN memory DMA engine is busy
SRC_MEM_ADDR

Address offset: 0xC28

Data source address in memory.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWADDRSource address in memory.
SRC_MEM_SIZE

Address offset: 0xC2C

The number of bytes to be read from memory. Writing to this register triggers the DMA operation.

Bit number313029282726252423222120191817161514131211109876543210
IDCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWSIZETotal number of bytes to read from memory.
BWFIRSTThis field is reserved
CWLASTThis field is reserved
SRC_SRAM_ADDR

Address offset: 0xC30

Data source address in RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWADDRSource address in RNG SRAM.
SRC_SRAM_SIZE

Address offset: 0xC34

The number of bytes to be read from RNG SRAM. Writing to this register triggers the DMA operation.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWSIZETotal number of bytes to read from RNG SRAM.
DIN_DMA_SRAM_BUSY

Address offset: 0xC38

Status register for DIN DMA engine activity when accessing RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSDIN RNG SRAM DMA engine status.
Idle0DIN RNG SRAM DMA engine is idle
Busy1DIN RNG SRAM DMA engine is busy
DIN_DMA_SRAM_ENDIANNESS

Address offset: 0xC3C

Configure the endianness of DIN DMA transactions towards RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENDIANEndianness of DIN DMA transactions towards RNG SRAM. The default value is little-endian.
LittleEndian0Use little-endian format for RNG SRAM DMA transactions
BigEndian1Use big-endian format for RNG SRAM DMA transactions
DIN_SW_RESET

Address offset: 0xC44

Reset the DIN DMA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the DIN DMA engine. The reset takes 4 CPU clock cycles to complete.
Enable1Reset DIN DMA engine.
DIN_CPU_DATA

Address offset: 0xC48

Specifies the number of bytes the CPU will write to the DIN_BUFFER, ensuring the cryptographic engine processes the correct amount of data.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWSIZEWhen using CPU direct write to the DIN_BUFFER, the size of input data in bytes should be written to this register.
DIN_WRITE_ALIGN

Address offset: 0xC4C

Indicates that the next CPU write to the DIN_BUFFER is the last in the sequence. This is needed only when the data size is NOT modulo 4 (e.g. HASH padding).

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWLASTNext CPU write to the DIN_BUFFER is the last word.
Confirm1The next CPU write is the last in the sequence.
DIN_FIFO_EMPTY

Address offset: 0xC50

Register indicating if DIN FIFO is empty and if more data can be accepted.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARSTATUSDIN FIFO status
NotEmpty0DIN FIFO is not empty
Empty1DIN FIFO is empty, and more data can be accepted
DIN_FIFO_RESET

Address offset: 0xC58

Reset the DIN FIFO, effectively clearing the FIFO for new data.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the DIN FIFO.
Enable1Reset DIN FIFO.

DOUT DMA engine

The Data OUT (DOUT) DMA engine transfers data from the CRYPTOCELL subsystem and its various cryptographic engines.

The DOUT DMA engine provides a comprehensive interface for to facilitate the transfer of data to the CPU or memory from the cryptographic engines. It includes a variety of registers that control direct data buffering, DMA operations, and data flow management.

Maximum DMA transaction size is limited to 216-1 bytes. If a DMA transaction is configured with a payload size above the maximum DMA transaction size limit, the DMA engine must be reset before being functional again using register DOUT_SW_RESET.

The flow demonstrated in Cryptographic flow shows how the DOUT DMA engine is configured to output data from the AES engine using registers DST_MEM_ADDR and DST_MEM_SIZE to define the output source address and number of output bytes, respectively.

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_DOUTAPPLICATION0x50845000HFSNSANoCRYPTOCELL DOUT DMA engine
Register overview
RegisterOffsetTZDescription
DOUT_BUFFER0xD00Cryptographic results directly accessible by the CPU.
DOUT_DMA_MEM_BUSY0xD20Status register for DOUT DMA engine activity when accessing memory.
DST_MEM_ADDR0xD28Data destination address in memory.
DST_MEM_SIZE0xD2CThe number of bytes to be written to memory.
DST_SRAM_ADDR0xD30Data destination address in RNG SRAM.
DST_SRAM_SIZE0xD34The number of bytes to be written to RNG SRAM.
DOUT_DMA_SRAM_BUSY0xD38Status register for DOUT DMA engine activity when accessing RNG SRAM.
DOUT_DMA_SRAM_ENDIANNESS0xD3CConfigure the endianness of DOUT DMA transactions towards RNG SRAM.
DOUT_READ_ALIGN0xD44Indication that the next CPU read from the DOUT_BUFFER is the last in the sequence. This is needed only when the data size is NOT modulo 4 (e.g. HASH padding).
DOUT_FIFO_EMPTY0xD50Register indicating if DOUT FIFO is empty or if more data will come.
DOUT_SW_RESET0xD58Reset the DOUT DMA engine.
DOUT_BUFFER

Address offset: 0xD00

Cryptographic results directly accessible by the CPU.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARDATAThis address can be used by the CPU to read data directly from the DOUT buffer.
DOUT_DMA_MEM_BUSY

Address offset: 0xD20

Status register for DOUT DMA engine activity when accessing memory.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSDOUT memory DMA engine status.
Idle0DOUT memory DMA engine is idle
Busy1DOUT memory DMA engine is busy
DST_MEM_ADDR

Address offset: 0xD28

Data destination address in memory.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWADDRDestination address in memory.
DST_MEM_SIZE

Address offset: 0xD2C

The number of bytes to be written to memory.

Bit number313029282726252423222120191817161514131211109876543210
IDCBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWSIZETotal number of bytes to write to memory.
BWFIRSTThis field is reserved
CWLASTThis field is reserved
DST_SRAM_ADDR

Address offset: 0xD30

Data destination address in RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWADDRDestination address in RNG SRAM.
DST_SRAM_SIZE

Address offset: 0xD34

The number of bytes to be written to RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWSIZETotal number of bytes to write to RNG SRAM.
DOUT_DMA_SRAM_BUSY

Address offset: 0xD38

Status register for DOUT DMA engine activity when accessing RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSTATUSDOUT RNG SRAM DMA engine status.
Idle0DOUT RNG SRAM DMA engine is idle
Busy1DOUT RNG SRAM DMA engine is busy
DOUT_DMA_SRAM_ENDIANNESS

Address offset: 0xD3C

Configure the endianness of DOUT DMA transactions towards RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWENDIANEndianness of DOUT DMA transactions towards RNG SRAM. The default value is little-endian.
LittleEndian0Use little-endian format for RNG SRAM DMA transactions
BigEndian1Use big-endian format for RNG SRAM DMA transactions
DOUT_READ_ALIGN

Address offset: 0xD44

Indication that the next CPU read from the DOUT_BUFFER is the last in the sequence. This is needed only when the data size is NOT modulo 4 (e.g. HASH padding).

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWLASTNext CPU read from the DOUT_BUFFER is the last word, and the remaining read aligned content can be flushed.
Flush1Flush the remaining read aligned content.
DOUT_FIFO_EMPTY

Address offset: 0xD50

Register indicating if DOUT FIFO is empty or if more data will come.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARSTATUSDOUT FIFO status
NotEmpty0DOUT FIFO is not empty, and more data will come
Empty1DOUT FIFO is empty
DOUT_SW_RESET

Address offset: 0xD58

Reset the DOUT DMA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWRESETWriting any value to this address resets the DOUT DMA engine. The reset takes 4 CPU clock cycles to complete.
Enable1Reset DOUT DMA engine.

HOST register interface

The HOST_RGF interface contains registers for CRYPTOCELL interrupt handling, in addition to power and clock configuration.

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_HOST_RGFAPPLICATION0x50845000HFSNSANoCRYPTOCELL HOST register interface
Register overview
RegisterOffsetTZDescription
IRR0xA00Interrupt request register. Each bit of this register holds the interrupt status of a single interrupt source. If corresponding IMR bit is unmasked, an interrupt is generated.
IMR0xA04Interrupt mask register. Each bit of this register holds the mask of a single interrupt source.
ICR0xA08Interrupt clear register. Writing a 1 bit into a field in this register will clear the corresponding bit in IRR.
ENDIANNESS0xA0CThis register defines the endianness of the Host-accessible registers, and can only be written once.
HOST_SIGNATURE0xA24This register holds the CRYPTOCELL subsystem signature. See reset value.
HOST_BOOT0xA28Hardware configuration of the CRYPTOCELL subsystem. Reset value holds the supported features.
HOST_CC_IS_IDLE0xA7CIdle state register for the CRYPTOCELL subsystem.
HOST_POWERDOWN0xA80This register start the power-down sequence.
IRR

Address offset: 0xA00

Interrupt request register. Each bit of this register holds the interrupt status of a single interrupt source. If corresponding IMR bit is unmasked, an interrupt is generated.

Bit number313029282726252423222120191817161514131211109876543210
IDHGFEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARSRAM_TO_DIN_INTThe RNG SRAM to DIN DMA done interrupt status. This interrupt is asserted when all data was delivered from RNG SRAM to DIN buffer.
BRDOUT_TO_SRAM_INTThe DOUT to RNG SRAM DMA done interrupt status. This interrupt is asserted when all data was delivered from DOUT buffer to RNG SRAM.
CRMEM_TO_DIN_INTThe memory to DIN DMA done interrupt status. This interrupt is asserted when all data was delivered from memory to DIN buffer.
DRDOUT_TO_MEM_INTThe DOUT to memory DMA done interrupt status. This interrupt is asserted when all data was delivered from DOUT buffer to memory.
ERAHB_ERR_INTThe AHB error interrupt status.
FRPKA_INTThe PKA end of operation interrupt status.
GRRNG_INTThe RNG interrupt status.
HRSYM_DMA_INTThe symmetric engine DMA completed interrupt status.
IMR

Address offset: 0xA04

Interrupt mask register. Each bit of this register holds the mask of a single interrupt source.

Bit number313029282726252423222120191817161514131211109876543210
IDHGFEDCBA
Reset 0x00000FFF00000000000000000000111111111111
IDR/WFieldValue IDValueDescription
ARWSRAM_TO_DIN_MASKThe RNG SRAM to DIN DMA done interrupt mask.
IRQEnable0Do not mask RNG SRAM to DIN DMA done interrupt i.e. interrupt is generated
IRQDisable1Mask RNG SRAM to DIN DMA done interrupt i.e. no interrupt is generated
BRWDOUT_TO_SRAM_MASKThe DOUT to RNG SRAM DMA done interrupt mask.
IRQEnable0Do not mask DOUT to RNG SRAM DMA done interrupt i.e. interrupt is generated
IRQDisable1Mask DOUT to RNG SRAM DMA done interrupt i.e. no interrupt is generated
CRWMEM_TO_DIN_MASKThe memory to DIN DMA done interrupt mask.
IRQEnable0Do not mask memory to DIN DMA done interrupt i.e. interrupt is generated
IRQDisable1Mask memory to DIN DMA done interrupt i.e. no interrupt is generated
DRWDOUT_TO_MEM_MASKThe DOUT to memory DMA done interrupt mask.
IRQEnable0Do not mask DOUT to memory DMA done interrupt i.e. interrupt is generated
IRQDisable1Mask DOUT to memory DMA done interrupt i.e. no interrupt is generated
ERWAHB_ERR_MASKThe AHB error interrupt mask.
IRQEnable0Do not mask AHB error interrupt i.e. interrupt is generated
IRQDisable1Mask AHB error interrupt i.e. no interrupt is generated
FRWPKA_MASKThe PKA end of operation interrupt mask.
IRQEnable0Do not mask PKA end of operation interrupt i.e. interrupt is generated
IRQDisable1Mask PKA end of operation interrupt i.e. no interrupt is generated
GRWRNG_MASKThe RNG interrupt mask.
IRQEnable0Do not mask RNG interrupt i.e. interrupt is generated
IRQDisable1Mask RNG interrupt i.e. no interrupt is generated
HRWSYM_DMA_MASKThe symmetric engine DMA completed interrupt mask.
IRQEnable0Do not mask the symmetric engine DMA completed interrupt i.e. interrupt is generated
IRQDisable1Mask the symmetric engine DMA completed interrupt i.e. no interrupt is generated
ICR

Address offset: 0xA08

Interrupt clear register. Writing a 1 bit into a field in this register will clear the corresponding bit in IRR.

Bit number313029282726252423222120191817161514131211109876543210
IDHGFEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWSRAM_TO_DIN_CLEARThe RNG SRAM to DIN DMA done interrupt clear.
BWDOUT_TO_SRAM_CLEARThe DOUT to RNG SRAM DMA done interrupt clear.
CWMEM_TO_DIN_CLEARThe memory to DIN DMA done interrupt clear.
DWDOUT_TO_MEM_CLEARThe DOUT to memory DMA done interrupt clear.
EWAHB_ERR_CLEARThe AHB error interrupt clear.
FWPKA_CLEARThe PKA end of operation interrupt clear.
GWRNG_CLEARThe RNG interrupt clear. Register RNG_ISR in the RNG engine must be cleared before this interrupt can be cleared.
HWSYM_DMA_CLEARThe symmetric engine DMA completed interrupt clear.
ENDIANNESS

Address offset: 0xA0C

This register defines the endianness of the Host-accessible registers, and can only be written once.

Bit number313029282726252423222120191817161514131211109876543210
IDDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWDOUT_WR_BGDOUT write endianness.
LittleEndian0Configure DOUT write as little-endian
BigEndian1Configure DOUT write as big-endian
BRWDIN_RD_BGDIN read endianness.
LittleEndian0Configure DIN read as little-endian
BigEndian1Configure DIN read as big-endian
CRWDOUT_WR_WBGDOUT write word endianness.
LittleEndian0Configure DOUT write word as little-endian
BigEndian1Configure DOUT write word as big-endian
DRWDIN_RD_WBGDIN read word endianness.
LittleEndian0Configure DIN read word as little-endian
BigEndian1Configure DIN read word as big-endian
HOST_SIGNATURE

Address offset: 0xA24

This register holds the CRYPTOCELL subsystem signature. See reset value.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x10E0000000010000111000000000000000000000
IDR/WFieldValue IDValueDescription
ARVALUEFixed-value identification signature used by host driver to verify CRYPTOCELL presence at this address.
HOST_BOOT

Address offset: 0xA28

Hardware configuration of the CRYPTOCELL subsystem. Reset value holds the supported features.

Bit number313029282726252423222120191817161514131211109876543210
IDbaZYXWVUTSRQPONMLKJIHGFFFEDCBA
Reset 0x5E62982E01011110011000101001100000101110
IDR/WFieldValue IDValueDescription
ARPOWER_GATING_EXISTS_LOCALIf this flag is set, full power gating is implemented
BRLARGE_RKEK_LOCALIf this flag is set, large RKEK is supported
CRHASH_IN_FUSES_LOCALIf this flag is set, HASH in fuses is supported
DREXT_MEM_SECURED_LOCALIf this flag is set, external secure memory is supported
ERRKEK_ECC_EXISTS_LOCAL_NIf this flag is set, RKEK ECC is supported
FRSRAM_SIZE_LOCALSRAM size
GRDSCRPTR_EXISTS_LOCALIf this flag is set, Descriptors are supported
HRPAU_EXISTS_LOCALIf this flag is set, PAU is supported
IRRNG_EXISTS_LOCALIf this flag is set, the RNG engine is present
JRPKA_EXISTS_LOCALIf this flag is set, the PKA engine is present
KRRC4_EXISTS_LOCALIf this flag is set, the RC4 engine is present
LRSHA_512_PRSNT_LOCALIf this flag is set, the HASH engine supports SHA512
MRSHA_256_PRSNT_LOCALIf this flag is set, the HASH engine supports SHA256
NRMD5_PRSNT_LOCALIf this flag is set, the HASH engine supports MD5
ORHASH_EXISTS_LOCALIf this flag is set, the HASH engine is present
PRC2_EXISTS_LOCALIf this flag is set, the C2 engine is present
QRDES_EXISTS_LOCALIf this flag is set, the DES engine is present
RRAES_XCBC_MAC_EXISTS_LOCALIf this flag is set, AES XCBC-MAC mode is supported
SRAES_CMAC_EXISTS_LOCALIf this flag is set, AES CMAC mode is supported
TRAES_CCM_EXISTS_LOCALIf this flag is set, AES CCM mode is supported
URAES_XEX_HW_T_CALC_LOCALIf this flag is set, AES XEX mode T-value calculation in HW is supported
VRAES_XEX_EXISTS_LOCALIf this flag is set, AES XEX mode is supported
WRCTR_EXISTS_LOCALIf this flag is set, AES CTR mode is supported
XRAES_DIN_BYTE_RESOLUTION_LOCALIf this flag is set, the AES engine data input support byte size resolution
YRTUNNELING_ENB_LOCALIf this flag is set, the AES engine supports tunneling operations
ZRSUPPORT_256_192_KEY_LOCALIf this flag is set, the AES engine supports 192/256 bits key sizes
aRONLY_ENCRYPT_LOCALIf this flag is set, the AES engine only support encryption
bRAES_EXISTS_LOCALIf this flag is set, the AES engine is present
HOST_CC_IS_IDLE

Address offset: 0xA7C

Idle state register for the CRYPTOCELL subsystem.

Other fields in this register will indicate which parts of CRYPTOCELL subsystem are busy.

Bit number313029282726252423222120191817161514131211109876543210
IDFEDCBA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARHOST_CC_IS_IDLECRYPTOCELL idle state.
Busy0CRYPTOCELL subsystem busy.
Idle1CRYPTOCELL subsystem idle.
BRSYM_IS_BUSYSymmetric flow busy state.
Busy1Symmetric flow busy.
Idle0Symmetric flow idle.
CRAHB_IS_IDLEAHB state machine idle state.
Busy0AHB state machine busy.
Idle1AHB state machine idle.
DRRNG_IS_IDLERNG engine idle state.
Busy0RNG engine busy.
Idle1RNG engine idle.
ERPKA_IS_IDLEPKA engine idle state.
Busy0PKA engine busy.
Idle1PKA engine idle.
FRCRYPTO_IS_IDLECryptographic flow idle state.
Busy0Cryptographic flow busy.
Idle1Cryptographic flow idle.
HOST_POWERDOWN

Address offset: 0xA80

This register start the power-down sequence.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWHOST_POWERDOWNPower down enable register.

RNG SRAM interface

The RNG_SRAM interface enable reading and writing data to RNG SRAM.

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_RNG_SRAMAPPLICATION0x50845000HFSNSANoCRYPTOCELL RNG SRAM interface
Register overview
RegisterOffsetTZDescription
SRAM_DATA0xF00Read/Write data from RNG SRAM
SRAM_ADDR0xF04First address given to RNG SRAM DMA for read/write transactions from/to RNG SRAM.
SRAM_DATA_READY0xF08RNG SRAM DMA engine is ready to read/write from/to RNG SRAM.
SRAM_DATA

Address offset: 0xF00

Read/Write data from RNG SRAM

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
ARWSRAM_DATA32 bits DMA read/write from/to RNG SRAM. A 'read' or 'write' operation to this register will trigger the DMA address to be automatically incremented.
SRAM_ADDR

Address offset: 0xF04

First address given to RNG SRAM DMA for read/write transactions from/to RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDAAAAAAAAAAAAAAA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWSRAM_ADDRRNG SRAM starting address
SRAM_DATA_READY

Address offset: 0xF08

RNG SRAM DMA engine is ready to read/write from/to RNG SRAM.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000100000000000000000000000000000001
IDR/WFieldValue IDValueDescription
ARSRAM_READYRNG SRAM DMA status.
Busy0DMA is busy
Idle1DMA is idle

MISC interface

The MISC interface controls clocks for the individual engines within the CRYPTOCELL subsystem.

Each cryptographic engine has an individual register for performing clock gating. Engine clock status is displayed in register CLK_STATUS.

Clock control for the GHASH engine is handled by enabling clock for the HASH engine, and then selecting GHASH engine in register HASH_SELECT.

Note: Clock control for the RNG engine is handled by register RNG_CLK and not through the MISC interface.

Registers

Instances
InstanceDomainBase addressTrustZoneSplit accessDescription
MapAttDMA
CC_MISCAPPLICATION0x50845000HFSNSANoCRYPTOCELL MISC interface
Register overview
RegisterOffsetTZDescription
AES_CLK0x810Clock control for the AES engine.
HASH_CLK0x818Clock control for the HASH engine.
PKA_CLK0x81CClock control for the PKA engine.
DMA_CLK0x820Clock control for the DMA engines.
CLK_STATUS0x824CRYPTOCELL clocks status register.
CHACHA_CLK0x858Clock control for the CHACHA engine.
AES_CLK

Address offset: 0x810

Clock control for the AES engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEEnables clock for the AES engine.
Disable0Disable clock for the AES engine.
Enable1Enable clock for the AES engine.
HASH_CLK

Address offset: 0x818

Clock control for the HASH engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEEnables clock for the HASH engine.
Disable0Disable clock for the HASH engine.
Enable1Enable clock for the HASH engine.
PKA_CLK

Address offset: 0x81C

Clock control for the PKA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEEnables clock for the PKA engine.
Disable0Disable clock for the PKA engine.
Enable1Enable clock for the PKA engine.
DMA_CLK

Address offset: 0x820

Clock control for the DMA engines.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEEnables clock for the DMA engines.
Disable0Disable clock for the DMA engines.
Enable1Enable clock for the DMA engines.
CLK_STATUS

Address offset: 0x824

CRYPTOCELL clocks status register.

Bit number313029282726252423222120191817161514131211109876543210
IDEDCBA
Reset 0x0000010000000000000000000000000100000000
IDR/WFieldValue IDValueDescription
ARAES_CLKStatus of AES engine clock.
Disabled0Clock for AES engine is disabled
Enabled1Clock for AES engine is enabled
BRHASH_CLKStatus of HASH engine clock.
Disabled0Clock for HASH engine is disabled
Enabled1Clock for HASH engine is enabled
CRPKA_CLKStatus of PKA engine clock.
Disabled0Clock for PKA engine is disabled
Enabled1Clock for PKA engine is enabled
DRCHACHA_CLKStatus of CHACHA engine clock.
Disabled0Clock for CHACHA engine is disabled
Enabled1Clock for CHACHA engine is enabled
ERDMA_CLKStatus of DMA engines clock.
Disabled0Clocks for DMA engines are disabled
Enabled1Clocks for DMA engines are enabled
CHACHA_CLK

Address offset: 0x858

Clock control for the CHACHA engine.

Bit number313029282726252423222120191817161514131211109876543210
IDA
Reset 0x0000000000000000000000000000000000000000
IDR/WFieldValue IDValueDescription
AWENABLEEnables clock for the CHACHA engine.
Disable0Disable clock for the CHACHA engine.
Enable1Enable clock for the CHACHA engine.