CCB-ECDSA signature STM32H5F5J how to intro

1. Introduction

The coupling and chaining bridge (CCB) is a hardware security mechanism on the STM32H5F5J. It protects sensitive cryptographic material during protected public key accelerator (PKA) operations. For the elliptic curve digital signature algorithm (ECDSA) use case, the system first secures the private key during blob creation. It then reuses the key during blob use to generate a signature under controlled, authenticated conditions. The CCB manages secure interactions among the CPU, PKA, secure AES (SAES), and random number generator (RNG), helping keep the private key protected throughout the workflow.

A protected ECDSA blob typically contains:

  • IV: A random initialization value used to start the secure encryption process.
  • Tag: An authentication value used to verify the integrity and authenticity of the blob.
  • Wrapped key: The private key encrypted and protected within the blob.

This document describes:

  • The overall ECDSA secure workflow
  • The role of each peripheral
  • The coupling and chaining relationships
  • The expected sequence of operations

2. Purpose of the CCB in ECDSA protection

The CCB ensures that:

  • The ECDSA private key is not handled in the clear once protection is enabled.
  • The key is tied to the device through the secure hardware path.
  • The protected blob can be stored and reused securely.
  • The protected PKA operation is authorized only when the expected secure sequence is followed.

3. Main peripherals

The protection mechanism relies on the coordinated use of:

  • PKA for cryptographic computation
  • SAES for secure wrapping and tag generation
  • RNG for random data generation
  • CCB for sequence control and data routing

CPU: Initiates the protected operation and writes the parameters required for blob creation or use.

PKA: Performs the protected ECDSA computation.

SAES: Wraps or unwraps sensitive material and manages the GCM-based protection flow.

RNG: Provides random values for IV generation and, when required, protected key generation.

CCB: Coordinates the secure sequence through:

  • CCOP (Coupling and Chaining Operation) selection
  • OPSTEP (operation step) sequencing
  • Data coupling and chaining
  • Validation of the protected execution context

4. ECDSA secure workflow overview

The ECDSA signature flow is divided into two main phases:

  • Blob creation: The private key is wrapped in a protected blob, an IV is generated, and a reference tag is produced. Verification and validation are mandatory during this phase.
  • Blob use for signing: The protected blob is reloaded and validated before being used to perform the ECDSA signature operation.

5. Blob creation phase

5.1. Objective

The purpose of blob creation is to convert the ECDSA private key into a protected object that can later be safely reused.

Figure 1: ECDSA key wrapping flow (creation and validation)

5.2. CCOP value

Two CCOP values are allowed for blob creation:

  • CCOP = 0xC0: ECDSA signature blob creation using a private key provided by the CPU.
  • CCOP = 0xC2: ECDSA signature blob creation using a private key provided by the RNG.

5.3. Blob creation flow

Figure 2 illustrates the ECDSA blob creation workflow and the role of each main input and processing step.

  • Message hash: The hash of the data to be signed is prepared and loaded into the protected flow.
  • Private key: The private key is handled within the secure CCB process and is never exposed in the clear.
  • Secure setup: The system prepares the cryptographic environment by enabling the required blocks and selecting the protected ECDSA operation.
  • Random IV generation: The CCB uses the embedded hardware RNG to generate the blob IV.
  • ECDSA parameter loading: The PKA receives the curve and signature parameters required for the operation.
  • Key wrapping: The private key is encrypted and stored as a wrapped key in the blob.
  • Reference tag generation: The SAES generates the authentication tag used to protect the blob’s integrity.
  • Blob validation: The created blob is checked to confirm that it is consistent and ready for later use.
Figure 2: ECDSA blob Creation flow

During blob creation:

  • The PKA is enabled.
  • The SAES is configured in AES-GCM mode.
  • The IV is generated.
  • The private key is written to the secure path.
  • The key is encrypted into a blob.
  • The tag is computed.
  • The blob is verified before storage.

5.4. Coupling and chaining during blob creation

CPU → PKA + SAES

Type: Coupling

The CPU writes the protected ECDSA parameters. The CCB redirects these writes into the protected flow, ensuring that they use the secure hardware path.

RNG → SAESType: Chaining

The RNG supplies the random IV values used by the SAES during GCM initialization.

RNG → PKAType: Chaining

When the private key is generated by the RNG, the CCB routes the random data directly to PKA memory.

PKA → SAESType: Chaining

The PKA contents are transferred to the SAES input for cryptographic protection.

SAES → CCBType: Chaining

The SAES produces the authentication tag, which the CCB compares with the reference tag.

6. Blob usage for signing

6.1. Objective

The blob use phase reloads the protected blob and authorizes the PKA to perform the ECDSA signature.

Figure 3: ECDSA signing and blob use

6.2. CCOP value

The document indicates:

  • CCOP = 0xC3 for ECDSA signature blob use.

6.3. Blob usage for signing flow

Figure 4: Blob usage for signing flow


During blob use:

  • The protected blob is reloaded.
  • The IV saved during blob creation is restored.
  • The reference tag is written to the CCB reference-tag registers.
  • The secure context is validated.
  • The private key is restored in protected form.
  • The PKA computes the ECDSA signature.

6.4. Coupling and chaining during blob use

CPU → PKA + SAES

Type: Coupling

The CPU writes the input message hash and signing parameters into the protected sequence.

SAES → CCB

Type: Chaining

The SAES-generated tag is compared with the reference tag programmed in the CCB_REFTAGRx registers.

SAES → PKA

Type: Chaining

Once the protected context is validated, the private key is restored from its encrypted form into the PKA path.

RNG → PKA

Type: Chaining

The RNG provides the random nonce required for ECDSA signature computation.

PKA computation

Once all conditions are met, the PKA performs the signature operation. The signature result is read from PKA RAM.

7. Register-driven execution

The sequence is controlled by:

  • CCOP: Selects the operation.
  • OPSTEP: Tracks progression through the internal steps.
  • CCB_BUSY: Indicates that the CCB is busy.
  • OPERR: Reports errors.
  • CCB_REFTAGRx: Holds the reference tag used for comparison.

If validation fails:

  • OPERR is set.
  • IPRST is asserted.
  • The sequence must be restarted.

8. Summary table

Phase CCOP Main objective Key peripherals
Blob creation 0xC0 / 0xC2 Wrap the private key into a protected blob CPU, PKA, SAES, RNG, CCB
Blob usage 0xC3 Validate the blob and generate the signature PKA, SAES, RNG, CCB

9. Conclusion

The protected ECDSA workflow on the STM32H5F5J consists of two secure phases:

  • Blob creation, which securely wraps and stores the private key.
  • Blob use, which validates the blob before authorizing signature generation.

The CCB uses coupling and chaining to ensure that data transfers among the CPU, PKA, SAES, and RNG follow the expected secure path.

10. References and literature