ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_rot_trailer_t Struct Reference

Authenticity trailer appended after a signed image body. More...

#include <ra8_rot.h>

Data Fields

uint32_t magic
 k_ra8_rot_trailer_magic.
uint32_t version
 k_ra8_rot_version (trailer format).
uint32_t img_version
 Monotonic anti-rollback image ver.
uint32_t body_len
 Body length the digest covers.
uint32_t sig_len
 Active signature length, bytes.
uint8_t digest [k_ra8_rot_digest_bytes]
 SHA-256 of the body (pre-check).
uint8_t sig [k_ra8_rot_sig_bytes]
 ECDSA-P256 raw r||s over the digest.

Detailed Description

Authenticity trailer appended after a signed image body.

Laid out immediately after the body_len image body. Every field is 32-bit aligned. sig_len records the active signature length so the same struct carries a 64-byte ECDSA-P256 signature on target and the 32-byte fake stand-in signature in RA8_OFF_TARGET (the unused tail of sig is ignored). img_version is the monotonic anti-rollback version consumed by ra8_dfu_antirollback.h (downgrade protection).

Invariant
magic == k_ra8_rot_trailer_magic for a signed image.
version == k_ra8_rot_version for this verifier revision.
body_len equals the byte length the digest covers.
sig_len <= k_ra8_rot_sig_bytes.
Note
img_version IS covered by sig: the ECDSA signature authenticates SHA-256(img_version_le || body_digest) rather than the bare body digest (see ra8_rot_verify_image), so an attacker holding an older validly-signed image cannot raise this field to defeat anti-rollback – the forged version invalidates the signature. The signing tool scripts/secrets/rot_sign.py binds the identical material. digest itself still covers only the body. See ra8_dfu_antirollback.h for the monotonic-counter check.
See also
ra8_rot_verify_image

Definition at line 150 of file ra8_rot.h.

Field Documentation

◆ body_len

uint32_t ra8_rot_trailer_t::body_len

Body length the digest covers.

Definition at line 154 of file ra8_rot.h.

◆ digest

uint8_t ra8_rot_trailer_t::digest[k_ra8_rot_digest_bytes]

SHA-256 of the body (pre-check).

Definition at line 156 of file ra8_rot.h.

◆ img_version

uint32_t ra8_rot_trailer_t::img_version

Monotonic anti-rollback image ver.

Definition at line 153 of file ra8_rot.h.

◆ magic

uint32_t ra8_rot_trailer_t::magic

k_ra8_rot_trailer_magic.

Definition at line 151 of file ra8_rot.h.

◆ sig

uint8_t ra8_rot_trailer_t::sig[k_ra8_rot_sig_bytes]

ECDSA-P256 raw r||s over the digest.

Definition at line 157 of file ra8_rot.h.

◆ sig_len

uint32_t ra8_rot_trailer_t::sig_len

Active signature length, bytes.

Definition at line 155 of file ra8_rot.h.

◆ version

uint32_t ra8_rot_trailer_t::version

k_ra8_rot_version (trailer format).

Definition at line 152 of file ra8_rot.h.


The documentation for this struct was generated from the following file: