42. Coupling and chaining bridge (CCB)

42.1 CCB introduction

The coupling and chaining bridge (CCB) is a sophisticated security mechanism designed to ensure that private keys are protected, even against CPU access, and are wrapped with unique device keys, and stored securely in a secure storage.

The CCB can be programmed to implement special coupling and chaining operations required to protect private keys used in PKA protected operations.

These coupling and chaining operations involve the PKA, the SAES, and sometimes the RNG peripherals.

42.2 CCB main features

The principal features of the CCB are listed below:

42.3 CCB implementation

The CCB connects the peripherals listed in Table 413.

Table 413. Peripherals connected by CCB interconnect

PeripheralCoupling and chaining feature(1)Tamper status flag in CCB_SR
RNGYesTAMP_EVT0
SAESYesTAMP_EVT1
PKAYesTAMP_EVT2 (registers + PKA RAM)
TAMP_EVT3 (PKA operations)
CCBYesTAMP_EVT4
AESNoTAMP_EVT5
HASHNo-

1. See Section 42.4.4 for details.

42.4 CCB functional description

42.4.1 CCB block diagram

Figure 425 shows the CCB block diagram. Peripherals connected to the CCB interconnect, with optional coupling/chaining features, are defined in Section 42.3.

Figure 425. CCB block diagram

Figure 425. CCB block diagram. The diagram shows a 32-bit AHB bus connected to a CCB (+ AHB interconnect) block. The CCB block contains a CCB interconnect, RNG, SAES, PKA, and CCB registers. The CCB interconnect is connected to a Peripheral block. The RNG, SAES, and PKA blocks are connected to the CCB interconnect via optional coupling or chaining features, indicated by dashed lines and asterisks. The CCB registers are connected to the CCB interconnect. The CCB block is connected to the RCC block via four enable signals: rng_hclk_en, pka_hclk_en, saes_hclk_en, and ccb_hclk_en.

The diagram illustrates the CCB block structure. A 32-bit AHB bus with an hclk signal enters the CCB (+ AHB interconnect) block. Inside this block, the CCB interconnect is linked to a Peripheral block. Below the interconnect, RNG, SAES, and PKA blocks are shown, each connected to the interconnect via dashed lines marked with (*), signifying optional coupling or chaining. CCB registers are also part of the block. Four enable signals (rng_hclk_en, pka_hclk_en, saes_hclk_en, ccb_hclk_en) exit the CCB block and enter the RCC block. A note at the bottom states: (*) Optional coupling or chaining. The reference code MSv71138V2 is in the bottom right corner.

Figure 425. CCB block diagram. The diagram shows a 32-bit AHB bus connected to a CCB (+ AHB interconnect) block. The CCB block contains a CCB interconnect, RNG, SAES, PKA, and CCB registers. The CCB interconnect is connected to a Peripheral block. The RNG, SAES, and PKA blocks are connected to the CCB interconnect via optional coupling or chaining features, indicated by dashed lines and asterisks. The CCB registers are connected to the CCB interconnect. The CCB block is connected to the RCC block via four enable signals: rng_hclk_en, pka_hclk_en, saes_hclk_en, and ccb_hclk_en.

42.4.2 CCB internal signals

Table 414 describes the relevant internal signals interfacing the CCB peripheral. Signals targeting peripherals connected to the CCB are not listed.

Table 414. CCB internal input/output signals

Signal nameSignal typeDescription
hclkDigital inputInterconnect system clock input
ccb_hclk_enDigital outputCCB clock request to the RCC
x_hclk_enDigital outputPeripheral x clock request to the RCC (x = SAES, PKA, or RNG)

42.4.3 CCB reset and clocks

The CCB shares the same clock used by the AHB bus. Once the CCB clock is activated in the RCC, and coupling and chaining activity is activated by setting CCOP ≠ 0 in CCB_CR, the CCB automatically requests the RCC to enable RNG, SAES, and PKA clocks. These clocks remain enabled until the application gates them in the RCC, with CCOP cleared in the CCB_CR register.

The CCB has a dedicated reset bit in the RCC, and a system reset input. Locally to the CCB it is also possible to trigger a reset of the peripheral based on IPRST (do not use it when the application does not use CCB) in the CCB_CR register (refer to the bitfield description for details). Status register CCB_SR has a specific reset behavior (see Section 42.7.2).

When at least a cryptographic peripheral raises a tamper event, the CCB requests its clock to the RCC. The tamper status TAMP_EVTi of these peripherals can be found in the CCB_SR register, as defined in Section 42.3.

42.4.4 CCB coupling and chaining

Note: The selection of these chaining modes is defined in Section 42.5. In most of these operations, a read of the PKA RAM returns 0 (shown with a purple circle in the following figures).

Coupling CPU → PKA + SAES (write)

When the corresponding OPSTEP is selected, the CCB takes the write requests that go to the PKA RAM, and sends them to SAES_DINR, as shown in Figure 426. Write to SAES_DINR is not coupled to the PKA. The CCB sends both data and address to SAES_DINR.

Figure 426. CCB operation CPU → PKA + SAES (write)

Diagram of CCB operation CPU → PKA + SAES (write).

This diagram illustrates the CCB operation for writing to PKA and SAES. A CPU is connected to a System bus, which in turn connects to a CCB block. The CCB block has bidirectional data paths to SAES and PKA. A pink dashed line labeled 'Coupling' shows a path from the CCB to SAES and then to PKA. A pink circle with a minus sign is located on the path between SAES and PKA. The reference code 'MSv71139V1' is in the bottom right corner.

Diagram of CCB operation CPU → PKA + SAES (write).

Chaining PKA → SAES

When the corresponding OPSTEP is selected, for each 32-bit write request to the PKA RAM of magic number 0xCCB, the CCB generates a read request from the write target (in the PKA RAM) to SAES_DINR.

Figure 427. CCB operation PKA → SAES

Diagram of CCB operation PKA → SAES.

This diagram shows the CCB operation for chaining from PKA to SAES. A CPU connects to a System bus, which connects to a CCB block. The CCB block has bidirectional data paths to SAES and PKA. A blue dashed line labeled 'Chaining' shows a path from the CCB to SAES and then to PKA. A blue circle with a minus sign is located on the path between SAES and PKA. The label '0xCCB' is shown near the PKA block. The reference code 'MSv71140V1' is in the bottom right corner.

Diagram of CCB operation PKA → SAES.

Chaining SAES → PKA

When the corresponding OPSTEP is selected, the CCB takes the write requests that go to the PKA RAM, and substitutes these data by a 32-bit word coming from SAES_DOUTR. When available, this chaining is activated when the application writes 0xCCB to PKA RAM.

Figure 428. CCB operation SAES → PKA

Diagram of CCB operation SAES → PKA.

This diagram illustrates the CCB operation for chaining from SAES to PKA. A CPU connects to a System bus, which connects to a CCB block. The CCB block has bidirectional data paths to SAES and PKA. A blue dashed line labeled 'Chaining' shows a path from the CCB to SAES and then to PKA. A blue circle with a minus sign is located on the path between SAES and PKA. The reference code 'MSv71150V1' is in the bottom right corner.

Diagram of CCB operation SAES → PKA.

Chaining SAES → CCB

When the corresponding OPSTEP is selected, the CCB takes the read requests to SAES_DOUTR, and sends them to the system interconnect and to CCB_REFTAGRx holding the reference TAG information. For confidentiality reason, read data toward system bus are zeroed by the CCB.

If the CCB finds that the transfered value matches its reference information, it signals to the PKA that it can proceed with the protected PKA operation (START bit can be set).

Figure 429. CCB operation SAES → CCB

Block diagram showing the CCB operation for SAES to CCB chaining. A CPU is connected to a System bus. The CCB block contains a REFTAG register and interfaces with SAES and PKA. A solid blue arrow shows data flow from SAES to CCB. A dashed blue arrow labeled 'Chaining' shows data flow from CCB to the System bus. A purple circle with a minus sign indicates a comparison between the REFTAG and incoming data. A signal labeled 'operation ok/ not ok' goes from the CCB to the PKA.

MSv71151V1

Block diagram showing the CCB operation for SAES to CCB chaining. A CPU is connected to a System bus. The CCB block contains a REFTAG register and interfaces with SAES and PKA. A solid blue arrow shows data flow from SAES to CCB. A dashed blue arrow labeled 'Chaining' shows data flow from CCB to the System bus. A purple circle with a minus sign indicates a comparison between the REFTAG and incoming data. A signal labeled 'operation ok/ not ok' goes from the CCB to the PKA.

Chaining RNG → PKA (write)

When the corresponding OPSTEP is selected, the CCB takes the write requests that go to the PKA RAM, and substitutes these data with random numbers coming from RNG_DR. For consistency, the application can write 0xCCB to activate this chaining.

Figure 430. CCB operation RNG → PKA (write)

Block diagram showing the CCB operation for RNG to PKA write chaining. A CPU is connected to a System bus. The CCB block interfaces with an RNG and a PKA. A dashed blue arrow labeled 'Chaining' shows data flow from the RNG to the CCB. A solid blue arrow shows data flow from the CCB to the PKA. A purple circle with a minus sign indicates a comparison within the CCB logic.

MSv71152V1

Block diagram showing the CCB operation for RNG to PKA write chaining. A CPU is connected to a System bus. The CCB block interfaces with an RNG and a PKA. A dashed blue arrow labeled 'Chaining' shows data flow from the RNG to the CCB. A solid blue arrow shows data flow from the CCB to the PKA. A purple circle with a minus sign indicates a comparison within the CCB logic.

Chaining RNG → SAES (write)

When the corresponding OPSTEP is selected, the CCB takes the write requests that go to SAES_IVR1 to IVR3, and substitutes these data with random numbers coming from RNG_DR. For consistency, the application can write 0xCCB to activate this chaining.

Figure 431. CCB operation RNG → SAES (write)

Diagram of CCB operation RNG → SAES (write). A CPU is connected to a System bus. The CCB is connected to the System bus and has internal connections to RNG and SAES. A blue arrow shows data flow from RNG to SAES through the CCB. A dashed blue line labeled 'Chaining' is also shown.

The diagram illustrates the CCB operation for writing from the RNG to the SAES. A CPU is connected to a System bus. The CCB (Coupling and Chaining Bridge) is connected to the System bus and has internal connections to the RNG (Random Number Generator) and the SAES (Secure AES Coprocessor). A blue arrow indicates the data flow from the RNG to the SAES through the CCB. A dashed blue line labeled 'Chaining' is also shown, indicating a chaining operation.

Diagram of CCB operation RNG → SAES (write). A CPU is connected to a System bus. The CCB is connected to the System bus and has internal connections to RNG and SAES. A blue arrow shows data flow from RNG to SAES through the CCB. A dashed blue line labeled 'Chaining' is also shown.

MSv71153V1

42.4.5 CCB error management

When the CCB detects an error during a coupling and chaining operation (see Section 42.5), it sets accordingly OPERR[5:0] in CCB_SR (see Section 42.7.2 for the possible errors).

When OPERR[5:0] ≠ 0 in CCB_SR, the CCB raises IPRST in CCB_CR, sets OPSTEP[4:0] to 0x1F, and sets CCB_BUSY bit to 1. The application must clear IPRST to be able to use again the CCB and the peripheral(s) used by the coupling and chaining operation.

42.5 CCB coupling and chaining operations

When an application must enforce private key confidentiality by wrapping them with a 256-bit hardware unique key, the following steps are needed:

  1. 1. Select the protected operation in the PKA that uses this private key (ECDSA signature, scalar multiplication, modular exponentiation). Then, choose the CCOP value in the CCB that corresponds to the selected operation, as defined in this section. Then, as multiple cryptographic peripherals are used, make sure to follow the guidelines described in Section 42.5.1
  2. 2. When CCB is active (OPSTEP=0x1), select in the SAES the DHUK (with optional XOR with BHK), or unwrap in the SAES an existing blob encryption key that has been encrypted (in wrapped-key mode) using the DHUK. A 256-bit KEYSIZE must be selected.
    As the DHUK value is different when CCB is active or inactive, the operation of wrapping or unwrapping blob encryption key in SAES (with KMOD[1:0]=0x1) must be done when OPSTEP=0x1. Refer to operation with wrapped keys in Section 45: Secure AES coprocessor (SAES) for details.
  3. 3. When the application uses this protected operation in the PKA, it must load the related blob information in the PKA RAM and in SAES_DINR.
    • – If the information exactly matches the conditions of the blob generation (choice and order of the writes of protected parameters in the PKA RAM, selection of blob

encryption key, use of original encrypted secrets), the CCB allows the application to set START bit in PKA_CR.

Figure 432. Blob creation scenarios

Flowchart showing three blob creation scenarios: ECDSA signature, ECC scalar mult, and RSA modular exp. Each scenario includes steps for key generation, blob creation, public key computation, and verification/matching. A legend indicates hardware protected operations.

The diagram illustrates three scenarios for creating and verifying cryptographic blobs:

Legend:
Hardware protected operation (indicated by a circle around the step number)
(*) CCOP= 0x0

MSv58541V1

Flowchart showing three blob creation scenarios: ECDSA signature, ECC scalar mult, and RSA modular exp. Each scenario includes steps for key generation, blob creation, public key computation, and verification/matching. A legend indicates hardware protected operations.

This section describes how to do the above steps, for all available protected operations in the PKA. Note that:

Note: It is not possible to generate RSA key pairs with the CCB, they must be generated outside the device.

42.5.1 Preliminary steps before any protected operation

The following steps are required before running any operation described in this section:

  1. 1. Initialize the GTZC using the same security/privilege configuration protections for the SAES, PKA, RNG and CCB peripherals (see Section 5: Global TrustZone® controller (GTZC)). Otherwise OPERR=0x1A occurs (see Section 42.7.2).
  2. 2. Activate both RNG clocks, then initialize the peripheral to be fully functional, without pending errors.
  3. 3. Activate the PKA clock, then release the PKA reset. The PKA is functional once its RAM is automatically erased, and it has fetched the necessary random numbers. For further details refer to enabling/disabling PKA in Section 47: Public key accelerator (PKA).
  4. 4. Activate the SAES clock, then release the SAES reset. The SAES is functional once it has fetched necessary random numbers.
  5. 5. Activate the CCB clock, set IPRST bit in CCB_CR, then clear it when CCB_BUSY=0x0 in CCB_SR.

Note: Step 4 can be done before step 3, as CCOP = 0x0.

42.5.2 ECDSA signature

This PKA operation is protected against side-channel attacks. When CCOP = 0x0, all parameters loaded in the PKA RAM are managed in the clear by the application. When CCOP = 0xC3, the private key d can be manipulated by the application only if encrypted, using a special blob called “ECDSA signature blob”.

ECDSA signature blob creation

The ECDSA signing operation is prepared by generating and then encrypting the private key d, and computing the reference GCM tag. This process is summarized Table 415, with coupling and chaining operations described in Section 42.4.4. This sequence starts by generating the ECDSA private key before setting CCOP to 0xC0 in CCB_CR register (usage of 0xC2 value is not recommended).

Table 415. Blob creation steps for ECDSA signature (CCOP = 0b110000<i>0)

OP STEPMODE in PKAGCMPH in SAESCoupling or chainingEnd-step event(1)CPU action in the step
0x1N/AN/AN/AAES GCM selected, GCMPH = 0x0
  • – Enable the PKA in the correct mode, writing in PKA_CR MODE= 0x24 and EN=1 (repeat if EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  • – Optionally decrypt the blob encryption key in the SAES, using DHUK in 256-bit wrapped key mode.
  • – Set AES-GCM up in 256-bit encryption mode, with the DHUK or the decrypted key in register (if applicable).
  • –
0x20x0RNG -> SAESGCMPH = 0x1 (following GCM initialization)
  • – Complete GCM initialization in encryption mode. SAES_IVR1 to SAES_IVR3 are loaded with randoms.
  • – Read back blob IV in SAES_IVR registers.
0x30x240x1CPU -> PKA + SAESGCMPH = 0x2Write ECC signature parameters in the PKA RAM, clearing CCF flags in the SAES triggered after each 2x32-bit write.
0x6 (<i>=1)0x240x2RNG -> PKARNGOKF setWrite incrementally d in the PKA, using 0xCCB magic number. Values are drawn from the RNG. The PKA runs a special sanity check to verify random compliance with NIST standard (RNGERRF is set if sanity check fails).
0x4 (<i>=0)n/aDATAOKF setWrite incrementally d in the PKA.
0x8PKA -> SAESDATAOKF set, GCMPH = 0x3
  • – Read incrementally d from the PKA (writing 0xCCB magic numbers), and run AES encryption rounds. Special rule must be used for the last 64-bit word (see step 7 after the table).
  • – Read encrypted d in SAES_DOUTR.
  • – Repeat for each 16 bytes block of data.
0xA0x240x3N/AIPRST set in the CCB
  • – Complete GCM final.
  • – Read reference tag in the SAES. In this step keep the SAES enabled (EN bit set).
0x0N/AN/AN/AN/A

1. The application must clear and/or perform the described event for the CCB to automatically go to the next step.

The sequence described in Table 415 is detailed below. Refer to the table for OPSTEP values and related coupling/chaining modes.

  1. 1. Write CCOP = 0xC0 in CCB_CR.
  2. 2. Enable the PKA in the correct mode, writing in PKA_CR MODE=0x24 and EN=1 (repeat if the EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  3. 3. Initialize the ECC signature blob key in the SAES. This key can be the DHUK (KEYSEL = 0x1 or 0x4), or a key decrypted in 256-bit wrapped key mode by the DHUK (KEYSEL = 0x1 or 0x4, KMOD = 0x1, MODE = 0x1 or 0x2). See Section 45: Secure AES coprocessor (SAES) for details.
  4. 4. In the SAES, set the GCM chaining mode in encryption mode (CHMOD = 0x3, GCMPH = 0x0, MODE = 0x0, DATATYPE = 0x0). Then:
    1. a) Configure the 256-bit key size using KEYSIZE.
    2. b) Write SAES_IVRx, with any value (except SAES_IVR0 that must be equal to 0x2). For SAES_IV1 to IV3, random values are loaded into the SAES by the CCB. If an error occurs, RNGERRF is set in CCB_SR.
    3. c) Read back SAES_IVR1 to SAES_IVR3, and save the value in non-volatile memory after blob verification.
    4. d) Set EN in SAES_CR, and wait until CCF = 1 in SAES_ISR (end of GCM init).
    5. e) Clear CCF flag in SAES_ICR.
  5. 5. Select the header phase of the running GCM chaining mode (GCMPH = 0x1). Write the protected operation (ECDSA signature) mandatory parameters in the PKA RAM, as described in Section 47: Public key accelerator (PKA). Do the following when writing data in the PKA:
    1. a) Write two 32-bit word in the PKA RAM, then wait until CCF is set in SAES_ISR. An SAES interrupt can be triggered when this flag is set.
    2. b) Clear CCF in SAES_ICR.
  6. 6. Select the payload phase of the running GCM chaining mode (GCMPH = 0x2). Write the private key d in the PKA RAM using the following sequence:
    1. a) If CCOP = 0xC0, write the private key d value in the PKA RAM. If CCOP = 0xC2, write the 32-bit magic number 0xCCB to the private key d parameter addresses in the PKA memory. The CCB then draws the value of d from the RNG, with PKA running a special sanity check to verify random compliance with NIST standard.
    2. b) Complete parameter information with the mandatory two 32-bit zeroed words. At the end of this process, the private key d of size d_size is written in the PKA RAM. Clear the error flag, then restart step 6 if the PKA sets RNGERRF when BUSY is cleared.
  7. 7. When the PKA sets its completion flag (RNGOKF if CCOP = 0xC2, DATAOKF if CCOP = 0xC0), clear it, then read the private key d in the PKA RAM using the sequence below (starting from the LSB word in the PKA RAM, and increasing the addresses modulo 0x8):
    1. a) For each 64-bit word in the PKA RAM, write twice the 32-bit magic number 0xCCB to the private key d parameter addresses in the PKA memory. The target content of the PKA memory is transfered to SAES_DINR by the CCB. Wait until CCF is set
  1. in SAES_ISR (end of AES encryption). An SAES interrupt can be triggered when this flag is set.
  2. b) Clear CCF flag in SAES_ICR. Then read the encrypted private key d in SAES_DOUT, to save it in the non-volatile memory after blob verification.
  3. c) For the final 64-bit word (mandatory zeroed word): if the d_size is proportional to 16 bytes (for example, for 192- and 521-bit curves), the final 64 bits must be written to with two 32-bit magic numbers 0xCCB. If the d_size is not proportional to 16 bytes (for example, for 256- and 512-bit curves), the final 64 bits must be written with 0s.
  4. 8. When the DATAOKF completion flag is set (private key d OK), and BUSY is cleared in SAES_SR, select the final phase of the running GCM chaining mode (GCMPH = 0x3), after having cleared DATAOKF. Write the last GCM block in SAES_DINR, then wait until CCF is set in SAES_ISR (end of GCM final).
  5. 9. Read SAES_DOUTR four times to retrieve the ECDSA signature blob reference tag. Save it in the non-volatile memory after blob verification. Do not disable SAES by clearing the EN bit.
  6. 10. Clear CCOP by setting IPRST bit in CCB_CR. After CCB_BUSY is cleared in CCB_SR, clear the IPRST bit. The SAES, and PKA can again be used for any tasks. They are unprotected by the CCB until CCOP is written different from 0.

ECDSA signature blob usage for ECDSA signature

Table 416 summarizes the ECDSA signing operation using the encrypted private key d, the reference blob IV, and the computed GCM tag of Table 415. Coupling and chaining traffic options are described in Section 42.4.4. This sequence starts by setting CCOP to 0xC3 in the CCB_CR register.

Table 416. Blob use steps for ECDSA signature (CCOP = 0b11000011)

OPSTEPMODE in PKAGCMPHCoupling or chaining operationsEnd-step event(1)CPU action in step
0x1N/AN/AN/AAES GCM selected, GCMPH = 0x0
  • – Enable the PKA in the correct mode, writing in PKA_CR MODE= 0x24 and EN=1 (repeat if EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  • – Optionally decrypt the blob encryption key in the SAES, using DHUK in 256-bit wrapped key mode.
  • – Set AES-GCM up in 256-bit encryption mode, with the DHUK or the decrypted key in register (if applicable).
  • –
0x120x0N/AGCMPH = 0x1 (following GCM initialization)
  • – Complete GCM initialization in decryption mode, using saved random IV.
  • – Write reference tag in CCB_REFTAGR.

Table 416. Blob use steps for ECDSA signature (CCOP = 0b11000011) (continued)

OPSTEPMODE in PKAGCMPHCoupling or chaining operationsEnd-step event(1)CPU action in step
0x130x240x1CPU → PKA + SAESGCMPH = 0x2Write ECC signature parameters in the PKA RAM, clearing CCF flags in the SAES, triggered after each 64-bit write.
0x140x2SAES → PKADATAOKF set
  • Write encrypted d in SAES_DINR, and runs AES decryption round.
  • Write incrementally private key d in the PKA, using 0xCCB magic number. A special rule must be used for the last 64-bit write (see step 7 in the sequence detailed after this table).
  • Repeat for each 16-byte block of data.
0x16RNG → PKARNGOKF set, GCMPH = 0x3Write incrementally k in the PKA, using 0xCCB magic number. Values are drawn from the RNG. The PKA runs a special sanity check to verify random compliance with NIST standard (RNGERRF is set if the sanity check fails).
0x170x3SAES → CCBTag matches REFTAGR?
  • Complete GCM final.
  • Read computed tag in the SAES (returns 0).
0x180x24N/AN/ASTART = 0x1Start the operation in PKA setting START bit in PKA_CR.
0x19(2)N/AN/APROCENDF setThe PKA computes the operation, PKA RAM is read as 0.
0x1AN/AN/AN/ARead signature (r,s) in the PKA RAM.
  1. 1. The application must clear and/or perform the described event for the CCB to automatically go to the next step.
  2. 2. SAES cannot be used for any operations, for security reasons..

The sequence described in Table 416 is detailed below. Refer to the table for the OPSTEP values and related coupling and chaining modes.

  1. 1. Write CCOP = 0xC3 in CCB_CR.
  2. 2. Enable the PKA in the correct mode, writing in PKA_CR MODE=0x24 and EN=1(repeat if the EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  3. 3. Write the hash of the message in the PKA RAM
  4. 4. Initialize the ECC signature blob key in the SAES. This key can be the DHUK (KEYSEL = 0x1 or 0x4), or a key decrypted in 256-bit wrapped key mode by the DHUK (KEYSEL = 0x1 or 0x4, KMOD = 0x1, MODE = 0x1). Refer to Section 45: Secure AES coprocessor (SAES) for details.
  5. 5. Set the GCM chaining mode in decryption in the SAES (CHMOD = 0x3, GCMPH = 0x0, MODE = 0x2, DATATYPE = 0x0). Then:
    1. a) Configure the 256-bit key size using KEYSIZE.
    2. b) Write to SAES_IVRx registers the value saved in non-volatile memory.
    3. c) Set EN in SAES_CR, and wait until CCF is set in SAES_ISR (end of GCM init).
    4. d) Clear CCF flag in SAES_ICR.
    5. e) Write to CCB_REFTAGR registers, the ECDSA signature blob reference tag value saved in non-volatile memory.
  6. 6. Select the header phase of the running GCM chaining mode (GCMPH = 0x1). Write the protected operation (ECDSA signature) mandatory parameters in the PKA RAM,
  1. exactly as done during the blob creation. See step 5 in ECDSA signature blob creation for details.
  2. 7. Select the payload phase of the running GCM chaining mode (GCMPH = 0x2). Write the protected private key d in the PKA RAM, following the below sequence (starting from the LSB word in the PKA RAM, and increasing the addresses modulo 0x8):
    1. a) Writetwo 64-bit words of encrypted private key d in SAES_DINR. Wait until CCF is set in SAES_ISR (end of AES decryption). An SAES interrupt can be triggered when this flag is set.
    2. b) Clear the CCF flag in the SAES_ICR register. Then, for both 64-bit words, write four times the 32-bit magic number 0xCCB to the private key d parameter addresses in the PKA memory. The CCB transfers the clear-text content of SAES_DOUTR to the PKA.
    3. c) For the final 64-bit word (mandatory zeroed word): If d_size defined in step 6 in ECDSA signature blob creation is not proportional to 16-bytes (for example, for 256- and 512-bit curves), the final 64 bits must be written with 0s.
  3. 8. When DATAOKF = 1 in PKA_SR (private key d ok), clear this flag. Then write to the integer k parameter addresses in the PKA memory, starting from the LSB word in the PKA RAM, and increasing the addresses modulo 0x8. The CCB draws the value of k from the RNG. The PKA then runs a special sanity check to verify random compliance with NIST standard. Clear the error flag, then restart step 7 if the PKA sets RNGERRF when BUSY is cleared.
  4. 9. When RNGOKF = 1 in PKA_SR (random k ok), clear this flag. Then select the final phase of the running GCM chaining mode (GCMPH = 0x3). Write the last GCM block in SAES_DINR. Then wait until CCF is set in SAES_ISR (end of GCM final).
  5. 10. Read four times SAES_DOUTR (returns 0s). If PKA parameters were written exactly like during the blob creation, and the correct private key d was used, and all expected DATAOKF/RNGOKF flags were raised then cleared, the application can set START bit in PKA_CR to run the ECDSA signature operation. Otherwise, IPRST in CCB_CR must be used to restart the sequence from step 1.
  6. 11. Clear CCOP by setting IPRST in CCB_CR. After CCB_BUSY is cleared in CCB_SR, clear the IPRST bit. The SAES, and PKA can again be used for any tasks. They are unprotected by the CCB until CCOP in CCB_CR is written different from 0.

ECDSA signature blob use for public-key computation

The ECC public key computation using the encrypted private key d, the reference blob IV, and the computed GCM tag of Table 415 is summarized in Table 417. The additional ECDSA verification at the end of the sequence must be used before saving a new ECDSA signature blob in non-volatile memory. Shown coupling and chaining traffic options are described in Section 42.4.4. This sequence starts by setting CCOP to 0x81 in the CCB_CR register.

Table 417. Blob use steps for signing public key computation (CCOP = 0b10000001)

OPSTEPMODE
in PKA
GCMPH
in SAES
Coupling or
chaining
operations
End-step
event(1)
CPU action
0x1N/AN/AN/AAES GCM
selected,
GCMPH = 0x0
  • – Enable the PKA in the correct mode, writing in PKA_CR MODE= 0x20 and EN=1 (repeat if EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  • – Optionally decrypt blob encryption key in the SAES, using DHUK in 256-bit wrapped key mode.
  • – Set up AES-GCM in decryption mode with DHUK or the decrypted key in register (if applicable).
0x120x200x0N/AGCMPH = 0x1
(following GCM
initialization)
  • – Complete GCM initialization in decryption mode, using saved random IV.
  • – Write reference tag in CCB_REFTAGR.
0x130x1CPU -> PKA
+ SAES
GCMPH = 0x2Write ECC signature parameters in the PKA RAM, clearing CCF flags in SAES, triggered after each 2x32-bit write.
0x140x2SAES ->
PKA
DATAOKF set,
GCMPH = 0x3
  • – Write encrypted d in SAES DINR and run AES decryption round.
  • – Write incrementally scalar multiplier k in the PKA, using 0xCCB magic number.
  • – Repeat for each 16 bytes block of data.
0x170x3SAES ->
CCB
Tag matches
REFTAGR?
  • – Complete GCM final.
  • – Read computed tag in the SAES (returns 0).
0x180x20N/AN/ASTART = 0x1Start the operation in PKA setting START bit in PKA_CR.
0x19(2)N/AN/APROCENDF setThe PKA computes the operation. PKA RAM is read as 0.
Table 417. Blob use steps for signing public key computation (CCOP = 0b10000001)
OPSTEPMODE in PKAGCMPH in SAESCoupling or chaining operationsEnd-step event(1)CPU action
0x1A0x20N/AN/AIPRST set in the CCB
  • – Read public key point Q in PKA RAM
  • – Set IPRST in CCB
0x00x26N/AN/AN/A
  • Clear the IPRST bit in CCB when CCB_BUSY and OPSTEP are cleared in CCB_SR.
  • – Before writing new ECDSA signature blob in non-volatile memory do an initial digital signature, as summarized in Figure 432.
  • – Enable the PKA
  • – Write MODE= 0x24 in the PKA
  • – Write hash z & random nonce k in PKA RAM
  • – Write in PKA RAM the same curve parameters and private key d as the current ECDSA signature blob
  • – Start the operation setting START bit in PKA_CR
  • – Wait for PROCENDF bit is set. If error code= 0xD60D save the computed signature in temporary RAM.
  • – Finally, verify the above generated ECDSA signature.
  • – Write MODE= 0x26 in the PKA
  • – Write the same hash z as above in PKA RAM
  • – Write ECDSA verification parameters in PKA, including the public key coordinates computed in step 0x1A.
  • – Start the operation setting START bit in PKA_CR
  • – Wait for PROCENDF bit is set. If the signature is valid save the created blob in non-volatile memory.
  1. 1. The application must clear and/or perform described event for CCB to automatically go to the next step.
  2. 2. SAES cannot be used for any operations, for security reasons.

42.5.3 ECC scalar multiplication

This operation consists in the computation of k × P, where P is a point on a curve over prime fields, and “x” is the elliptic curve scalar point multiplication. The computation result is a point that belongs to the same curve, or a point at infinity.

The scalar multiplication operation is protected against side-channel attacks. When CCOP = 0x0 in CCB_CR, all parameters loaded in the PKA RAM are managed in the clear by the application. When CCOP = 0x81, the scalar multiplier k can be manipulated by the application only if encrypted, using a special blob called “ECC key blob”.

Scalar multiplication “ECC key” blob creation

The scalar multiplication operation is prepared by generating then encrypting the scalar multiplier k, and computing the reference GCM tag. This process is summarized in Table 418. Coupling and chaining operations described in Section 42.4.4. This sequence starts by generating the scalar multiplier k before setting CCOP to 0x80 in CCB_CR register (usage of 0x82 value is not recommended).

Table 418. Blob creation steps for scalar multiplication (CCOP = 0b100000&lt;i&gt;0)

OPSTEPMODE in PKAGCMPH in SAESCoupling or chaining operationsEnd-step event(1)CPU action in step
0x1N/AN/AN/AAES GCM selected, GCMPH = 0x0
  • – Enable the PKA in the correct mode, writing in PKA_CR MODE= 0x20 and EN=1 (repeat if EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  • – Optionally decrypt blob encryption key in the SAES, using DHUK in 256-bit wrapped key mode.
  • – Set up AES-GCM in 256-bit encryption mode with DHUK or the decrypted key in register (if applicable)
  • –
0x20x0RNG → SAESGCMPH = 0x1 (following GCM initialization)
  • – Complete GCM initialization in encryption mode. Registers IVR1 to 3 are loaded with randoms.
  • – Read back blob IV in IVR registers.
0x30x200x1CPU → PKA + SAESGCMPH = 0x2Write ECC scalar multiplication parameters in the PKA RAM, clearing CCF flags in SAES, triggered after each 64-bit write.
0x6 (<i>1)0x200x2RNG → PKARNGOKF setWrite incrementally k in the PKA, using 0xCCB magic number. Values are drawn from the RNG. The PKA runs a special sanity check to verify random compliance with NIST standard (RNGERRF is set if the sanity check fails).
0x4 (<i>0)N/ADATAOKF setWrite incrementally k in the PKA.
0x80x200x2PKA → SAESDATAOKF set, GCMPH = 0x3
  • – Read incrementally k from the PKA (writing 0xCCB magic numbers), and runs AES encryption rounds.
  • – Read encrypted k in SAES DOUTR.
  • – Repeat for each 16-byte block of data..
0xA0x3N/AIPRST set in the CCB
  • – Complete GCM final.
  • Read reference tag in the SAES. In this step keep the SAES enabled (EN bit set).
0x0N/AN/AN/AN/A

Clear the IPRST bit in CCB when CCB_BUSY and OPSTEP are cleared in CCB_SR.

Before writing new ECC key blob in non-volatile memory do a public key computation, as summarized in Figure 432.

  • – Enable the PKA
  • – Write MODE= 0x20 in the PKA
  • – Write base point G coordinates as input in PKA RAM
  • – Write in PKA RAM the same curve parameters and scalar multiplier k as the current ECC key blob
  • – Start the operation setting START bit in PKA_CR
  • – Wait for PROCENDF bit is set. If error code= 0xD60D save this reference public key in temporary RAM.

Finally, verify the newly created blob by using it for public key computation (see Table 419)

  1. 1. The application must clear and/or perform described event for CCB to automatically go to the next step.

Scalar multiplication blob use for example for ECC decryption

ECC scalar multiplication computation using the encrypted k, the reference blob IV and the computed GCM tag of Table 418 is summarized in Table 419. Shown coupling and chaining traffic options are described in Section 42.4.4. This sequence starts by setting CCOP to 0x81 in CCB_CR register.

Table 419. Blob use steps for scalar multiplication (CCOP = 0b10000001)

OPSTEPMODE in PKAGCMPH in SAESCoupling or chaining operationsEnd-step event(1)CPU action
0x1N/AN/AN/AAES GCM selected, GCMPH = 0x0
  • – Enable the PKA in the correct mode, writing in PKA_CR MODE= 0x20 and EN=1 (repeat if EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  • – Optionally, decrypt blob encryption key in the SAES, using DHUK in 256-bit wrapped key mode.
  • – Set up AES-GCM in decryption mode with DHUK or the decrypted key in register (if applicable).
  • – Write input point P coordinates in the PKA RAM. When computing a public key, write basepoint G coordinates.
0x120x200x0N/AGCMPH = 0x1 (following GCM initialization)
  • – Complete GCM initialization in decryption mode, using saved random IV.
  • – Write reference tag in CBB_REFTAGR.
0x130x1CPU -> PKA + SAESGCMPH = 0x2Write ECC scalar multiplication parameters in the PKA RAM, clearing CCF flags in the SAES, triggered after each 64-bit write.
0x140x2SAES -> PKADATAOKF set, GCMPH = 0x3
  • – Write encrypted k in SAES_DINR, and runs AES decryption round.
  • – Write incrementally scalar multiplier k in the PKA, using 0xCCB magic number.
  • – Repeat for each 16 bytes block of data.
0x170x3N/ATag matches REFTAGR?
  • – Complete GCM final.
  • – Read computed tag in the SAES (returns 0).
0x180x20N/AN/ASTART = 0x1Start the operation in PKA setting START bit in PKA_CR. Do not use SAES during this step (under reset).
0x19(2)PROCENDF setThe PKA computes the operation. The PKA RAM is read as 0.
0x1AN/ARead kP point coordinates in the PKA RAM. If this point is the public key verify it matches the reference public key computed in Table 418 before saving the created blob in non-volatile memory.
  1. 1. The application must clear and/or perform described event for CCB to automatically go to the next step.
  2. 2. SAES cannot be used for any operations, for security reasons.

42.5.4 RSA modular exponentiation

The modular exponentiation operation is commonly used to perform a single-step RSA operation. It consists in the computation of \(A^e \bmod n\).

This modular exponentiation operation (MODE = 0x3) is protected against side-channel attacks. When CCOP = 0x0, all parameters loaded in the PKA RAM are managed in the clear by the application. When CCOP = 0x45, the exponent e and ϕ value can only be manipulated encrypted by application, using a special blob called “RSA key blob”.

Modular exponentiation “RSA key” blob creation

Modular exponentiation operation is prepared by generating then encrypting the scalar multiplier k and computing the reference GCM tag. This process is summarized in Table 420. The coupling and chaining operations described in Section 42.4.4. This sequence starts by setting CCOP to 0x44 in CCB_CR register.

Table 420. Blob creation steps for modular exponentiation (CCOP = 0b01000100)

OPSTEPMODE in PKAGCMPH in SAESCoupling or chaining operationsEnd-step event(1)CPU action in step
0x1N/AN/AN/AAES GCM selected, GCMPH = 0x0
  • – Enable the PKA in the correct mode, writing in PKA_CR MODE= 0x3 and EN=1 (repeat if EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  • – Optionally decrypt blob encryption key in the SAES, using DHUK in 256-bit wrapped key mode.
  • – Set up AES-GCM in 256-bit encryption mode with DHUK or the decrypted key in register (if applicable).
0x20x0RNG -> SAESGCMPH = 0x1 (following GCM initialization)
  • – Complete GCM initialization in encryption mode. SAES_IVR1 to 3 registers are loaded with randoms.
  • – Read back blob IV in SAES_IVR registers.
0x30x030x1CPU -> PKA + SAESGCMPH = 0x2Write protected modular exponentiation parameters (PKA mode 0x3) in the PKA RAM, clearing CCF flags in the SAES triggered after each 2x32-bit write.
0x40x30x2N/ADATAOKF setWrite incrementally clear-text exponent e.
0x5DATAOKF setWrite incrementally clear-text ϕ.
0x8PKA -> SAESDATAOKF set
  • – Read incrementally e from the PKA (writing 0xCCB magic numbers), and runs AES encryption rounds.
  • – Read encrypted e in SAES_DOUTR.
  • – Repeat for each 16 bytes block of data.
0x9DATAOKF set, GCMPH = 0x3
  • – Read incrementally ϕ from the PKA (writing 0xCCB magic numbers), and run AES encryption rounds.
  • – Read encrypted ϕ in SAES_DOUTR.
  • – Repeat for each 16 bytes block of data
Table 420. Blob creation steps for modular exponentiation (CCOP = 0b01000100)
OPSTEPMODE in PKAGCMPH in SAESCoupling or chaining operationsEnd-step event(1)CPU action in step
0xA0x30x3N/AIPRST set in the CCB
  • – Complete GCM final.
  • – Read reference tag in the SAES.
In this step keep the SAES enabled (EN bit set).
0x0N/AN/AN/AN/AClear the IPRST bit in CCB when CCB_BUSY and OPSTEP are cleared in CCB_SR.
Before writing new RSA key blob in non-volatile memory do a reference modular exponentiation computation, as summarized on Figure 432.
  • – Enable the PKA
  • – Write MODE= 0x3 in the PKA
  • – Write a constant K as operand A in the PKA RAM
  • – Write in PKA RAM the same base parameters, phi and exponent e as the current RSA key blob
  • – Start the operation setting START bit in PKA_CR
  • – Wait for PROCENDF bit is set. If error code= 0xD60D save this reference Ke in temporary RAM.
Finally, verify the newly created blob by using it for Ke computation (see Table 421).

1. The application must clear and/or perform described event for CCB to automatically go to the next step.

Modular exponentiation blob use (for example for RSA decryption)

The modular exponentiation computation using the encrypted e and phi, the reference blob IV, and the computed GCM tag of Table 420 is summarized on Table 421. Shown coupling and chaining traffic options are described in Section 42.4.4. This sequence starts by setting CCOP to 0x45 in CCB_CR register.

Table 421. Blob use steps for modular exponentiation (CCOP = 0b01000101)
OPSTEPMODE in PKAGCMPH in SAESCoupling or chaining operationsEnd-step event(1)CPU action
0x1N/AN/AN/AAES GCM selected, GCMPH = 0x0
  • – Enable the PKA in the correct mode, writing in PKA_CR MODE= 0x3 and EN=1 (repeat if EN bit stays clear). Wait for INITOK=1 in PKA_SR.
  • – Optionally decrypt blob encryption key in the SAES, using DHUK in 256-bit wrapped key mode.
  • – Set up AES-GCM in decryption mode with DHUK or the decrypted key in register (if applicable).
  • – Write operand A in the PKA RAM. Write constant K as operand A defined in Table 420 when verifying the created blob.

Table 421. Blob use steps for modular exponentiation (CCOP = 0b01000101)

OPSTEPMODE
in PKA
GCMPH
in SAES
Coupling or
chaining
operations
End-step
event(1)
CPU action
0x120x030x0N/AGCMPH = 0x1
(following GCM
initialization)
– Complete GCM initialization in decryption mode, using
saved random IV.
– Write reference tag in CCB_REFTAGR.
0x130x1CPU → PKA
+ SAES
GCMPH = 0x2Write protected modular exponentiation parameters
(PKA mode 0x3) in the PKA RAM, clearing CCF flags in
the SAES, triggered after each -bit write.
0x140x2SAES → PKADATAOKF set– Write encrypted e in SAES_DINR, and runs AES
decryption round.
– Write incrementally exponent e in the PKA, using
0xCCB magic number.
– Repeat for each 16-byte block of data.
0x15DATAOKF set,
GCMPH = 0x3
– Write encrypted phi in SAES_DINR, and runs AES
decryption round.
– Write incrementally phi in the PKA, using 0xCCB
magic number.
– Repeat for each 16-byte block of data.
0x170x3SAES →
CCB
Tag matches
REFTAGR?
– Complete GCM final.
– Read computed tag in the SAES (returns 0).
0x180x03N/AN/ASTART = 0x1Start the operation in PKA setting START bit in
PKA_CR.
0x19(2)PROCENDF setThe PKA computes the operation, PKA RAM is read as
0.
0x1AN/ARead \(A^e \bmod n\) in the PKA RAM. If the result is \(K^e \bmod n\) verify it matches the reference computed in Table 420
before saving the created blob in non-volatile memory.
  1. 1. The application must clear and/or perform described event for CCB to automatically go to the next step.
  2. 2. SAES cannot be used for any operations, for security reasons.

42.6 CCB interrupts

The CCB does not support any interrupt.

42.7 CCB registers

The following section provides information on registers.

Reserved bits (marked as Res.) must be kept at their reset values, unless otherwise specified.

For general information relative to register description, refer to Document conventions.

These registers are accessible through the AHB interface of the CCB (32-bit words only). All reads are supported. Writes accesses must be 32-bit word only (other access types generate an AHB error).

42.7.1 CCB control register (CCB_CR)

Address offset: 0x000

Reset value: 0x0000 0000

Following a CCB hardware reset, the above reset value applies if OPERR[5:0] = 0x0 and no TAMP_EVT bit is set.

31302928272625242322212019181716
IPRSTRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.CCOP[7:0]
rwrwrwrwrwrwrwrw

Bit 31 IPRST: CCB reset

Set this bit to start or abort any PKA protected operation defined in Section 42.5. IPRST bit must be low while writing to any CCB register.

After setting this bit, the application must clear it when CCB_BUSY and OPSTEP are cleared in CCB_SR (IPRST clear is ignored otherwise). After this clear all CCB registers are read with their reset values. Setting IPRST clears any data stored in the SAES and the PKA.

When IPRST and CCB_BUSY are set, SAES registers are not accessible (read as 0, write ignored), and writes to EN and START bits in PKA_CR are ignored.

This bit is set by CCB when OPERR[5:0] ≠ 0 or any TAMP_EVT bit is set.

Bits 30:8 Reserved, must be kept at reset value.

Bits 7:0 CCOP[7:0]: Coupling and chaining operation

These bits must be set according to the chosen PKA protected operation (see Section 42.5).

0x044: Modular exponentiation blob creation with priv key from the CPU

0x045: Modular exponentiation blob use

0x080: ECC scalar multiplication blob creation with priv key from the CPU

0x082: ECC scalar multiplication blob creation with priv key from the RNG

0x081: ECC scalar multiplication blob use, or ECDSA signature blob use for public key computation

0x0C0: ECDSA signature blob creation with priv key from the CPU

0x0C2: ECDSA signature blob creation with priv key from the RNG

0x0C3: ECDSA signature blob use for ECDSA signature

Note: When an operation not listed here is written by the application, the write to CCOP[7:0] is ignored. All these operations implement protections against side-channel attacks. Write to CCOP is ignored when CCB_BUSY is set in CCB_SR.

42.7.2 CCB status register (CCB_SR)

Address offset: 0x004

Reset value: 0x0000 0000

This register is reset by a system reset, or after clearing IPRST in CCB_CR. The CCB reset input from the RCC has no effect on this register.

31302928272625242322212019181716
Res.Res.TAMP_EVT5TAMP_EVT4TAMP_EVT3TAMP_EVT2TAMP_EVT1TAMP_EVT0Res.Res.Res.Res.Res.Res.Res.CCB_BUSY
rrrrrrr
1514131211109876543210
Res.Res.OPERR[5:0]Res.Res.Res.OPSTEP[4:0]
rrrrrrrrrrr

Bits 31:30 Reserved, must be kept at reset value.

Bits 29:24 TAMP_EVTi: Tamper i flag (i = 5 to 0)

0: No event

1: Tamper event i has been raised. Global tamper event is raised. See Section 42.3 for details on the events.

This bit is cleared by writing 0 to IPRST bit in CCB_CR. When at least one TAMP_EVT bit is set, CCB sets IPRST bit.

Bits 23:17 Reserved, must be kept at reset value.

Bit 16 CCB_BUSY: CCB busy

This flag is set when CCB is busy, or when OPSTEP[4:0] ≠ 0 following a CCB reset (hardware reset or use of IPRST in CCB_CR).

0: CCB idle

1: CCB busy or PKA RAM is being cleared following a peripheral reset.

When IPRST and CCB_BUSY are set, the SAES registers are not accessible (write ignored, read returns 0), and writes to EN or START bits in PKA_CR are ignored.

Bits 15:14 Reserved, must be kept at reset value.

Bits 13:8 OPERR[5:0]: Operation error

When an error is detected during a protected PKA operation, the CCB raises IPRST in CCB_CR, and OPSTEP[4:0] is set to 0x1F. The bitfield is cleared by setting IPRST to 0.

0x0: No error detected during protected PKA operation (if applicable)

0x1: CCB RCC reset has been detected when OPSTEP > 0x0

0x2: SAES RCC reset has been detected when OPSTEP > 0x0

0x3: PKA RCC reset has been detected when OPSTEP > 0x0

0x4: RNG RCC reset has been detected when OPSTEP > 0x0

0x5: The RCC has gated the CCB clock when OPSTEP > 0x0.

0x6: The RCC has gated the SAES clock when OPSTEP > 0x0.

0x7: The RCC has gated the PKA clock when OPSTEP > 0x0.

0x8: The RCC has gated the RNG clock when OPSTEP > 0x0.

0x9: Random in SAES_IV1 is trivial (all 0s or all 1s) when OPSTEP = 0x2

0xA: Random in SAES_IV2 is trivial (all 0s or all 1s) when OPSTEP = 0x2

0xB: Random in SAES_IV3 is trivial (all 0s or all 1s) when OPSTEP = 0x2

0xC: When OPSTEP = 0x17 SAES GCM TAG comparison with CCB_REFTAG failed, or a register different from SAES_DOUT was read in the SAES.

0xD: KEYSIZE ≠ 256 bits in SAES_CR when the SAES is enabled, and OPSTEP > 0x0.

0xE: CHMOD ≠ GCM in SAES_CR when 0x1 < OPSTEP < 0x18, or the SAES is not enabled, or KEYVALID is cleared when GCMPH > 0x0.

0xF: KMOD different from wrapped key mode in SAES_CR when the SAES is enabled, and OPSTEP = 0x1, or 0x1A.

0x10: KEYSEL ≠ 0x1 or 0x4 in SAES_CR when the SAES is enabled, KEYVALID is set, and OPSTEP = 0x1.

0x11: GCMPH not correct (not incremented) in SAES_CR when OPSTEP > 0x1.

0x12: MODE in SAES_CR does not match the expected value (selected by CCOP in CCB_CR) when OPSTEP > 0x1.

0x13: BUSY = 1 in SAES_SR when OPSTEP= 0x18 or 0x19. SAES must not be used when PKA is computing a protected operation.

0x14: EN = 0 in PKA_CR when OPSTEP > 0x2 (except 0x12). In other words, PKA must be enabled in any OPSTEP except 0x1, 0x2, or 0x12.

0x15: INITOK = 0 in PKA_SR when OPSTEP > 0x2 (except 0x12).

0x16: Authorized by local firewall, but unexpected AHB error detected when OPSTEP > 0x0.

0x17: LMF = 1 in PKA_SR (only ECDSA verification available) when OPSTEP > 0x0.

0x18: CCB_REFTAGRx registers are equal to 0 when OPSTEP > 0x12.

0x1A: Security, privilege protections inconsistent (see Section 5: Global TrustZone® controller (GTZC)) for the peripherals SAES, PKA, RNG, and CCB when OPSTEP > 0x0.

This error is also triggered when the protections change while OPSTEP > 0x0,

0x1B: MODE in PKA_CR does not match the expected value (selected by CCOP in CCB_CR) when OPSTEP > 0x0.

0x1C: OPSTEP end-step event not found at OPSTEP= 0x0 (SAES KEYVALID is set). Use CCB IPRST before starting a coupling and chaining operation.

0x1D: OPSTEP end-step event not found at OPSTEP = 0x1.

0x1E: OPSTEP end-step event not found at OPSTEP = 0x2.

0x1F: OPSTEP end-step event not found at OPSTEP = 0x3.

0x20: OPSTEP end-step event not found at OPSTEP = 0xA.

0x21: OPSTEP end-step event not found at OPSTEP = 0x12.

0x22: OPSTEP end-step event not found at OPSTEP = 0x13.

0x23: OPSTEP end-step event not found at OPSTEP = 0x17.

For error codes 0x1C to 0x23, details on end-step events are found in Section 42.5. Those errors are also triggered when values written in SAES_CR register do not correspond to the selected CCOP and the expectations in the current OPSTEP.

Bits 7:5 Reserved, must be kept at reset value.

Bits 4:0 OPSTEP[4:0]: Operation step

This read-only information indicates the current step of the coupling and chaining operation (indicated by CCOP). See Section 42.5 for details. .

This bitfield can be cleared only using IPRST in CCB_CR. OPSTEP[4:0] = 0x1F when the IPRST procedure is in progress.

42.7.3 CCB reference tag register (CCB_REFTAGRx)

Address offset: 0x010 + 0x4 * x (x = 0 to 3)

Reset value: 0x0000 0000

Writes to this register are ignored when CCB_BUSY is set in the CCB_SR register. The register is cleared when IPRST is set and CCB_BUSY is cleared.

31302928272625242322212019181716
REFTAG{i + 32 * x}
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
REFTAG{i + 32 * x}
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:0 REFTAG{i + 32 * x}: Reference tag bits {i + 32 * x} (i = 31 to 0)

The application must write in these registers, the reference GCM tag of the required operation blob (respectively ECC signature, ECC key, or RSA key). This enables the PKA protected operation (respectively ECC signature/public key computation, scalar multiplication, or modular exponentiation). Refer to Section 42.5 for details.

Write to this register is ignored unless OPSTEP = 0x12 in CCB_SR.

42.7.4 CCB register map

Table 422. CCB register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x000CCB_CRIPRSTRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CCOP[7:0]
Reset value000000000
0x004CCB_SRRes.Res.TAMP_EVT5TAMP_EVT4TAMP_EVT3TAMP_EVT2TAMP_EVT1TAMP_EVT0Res.Res.Res.Res.Res.Res.Res.CCB_BUSYRes.Res.OPERR[5:0]Res.Res.Res.OPSTEP[4:0]
Reset value000000000000000000
0x010 + 0x4 * x (x=0 to 3)CCB_REFTAGRxREFTAG{i + 32 * x} (i = 31 to 0)
Reset value00000000000000000000000000000000

Refer to Section 2.3: Memory organization for the register boundary addresses.