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

Cross-TU surface shared by the RSIP asymmetric + RSA split. More...

#include <stdint.h>
#include "ra8_attributes.h"
#include "ra8_rsip.h"
Include dependency graph for ra8_rsip_asym_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void internal_asym_push (ra8_rsip_off_t off, const uint8_t *buf, uint32_t len)
 Stream a byte buffer into an asymmetric input lane.
void internal_asym_pull (ra8_rsip_off_t off, uint8_t *buf, uint32_t len)
 Pull a byte buffer back through an asymmetric output lane.
void internal_zero_handle_tail (ra8_rsip_key_handle_t *handle, uint32_t words)
 Zero-fill the unused tail of a key-handle body buffer.

Detailed Description

Cross-TU surface shared by the RSIP asymmetric + RSA split.

Tag
[Ring 3 / HAL] {World: S}

Not part of the public API. The asymmetric slice of the RSIP-E50D HAL driver is split across two translation units:

  • ra8_rsip_asym.c – the OEM anti-rollback counter, wrapped-key vault, key wrap / unwrap, KDF, lifecycle / debug authorisation, tamper subsystem, DOTF key routing, and the shared byte-lane + handle-tail helpers below;
  • ra8_rsip_ecc.c – ECDSA sign / verify, ECDH key agreement, and Ed25519 PureEdDSA (fail-closed in production; no RSIP backend);
  • ra8_rsip_rsa.c – RSASSA sign / verify and RSAES encrypt / decrypt (fail-closed in production; no RSIP backend).

The ECC and RSA slices stream operand bytes through the engine's asymmetric input / output lanes. The helpers below are defined in ra8_rsip_asym.c and consumed by those TUs; their full Doxygen contract lives here at the shared declaration site. See CLAUDE.md "Test access to internal symbols (MC/DC scope)".

Since
0.1.0

Definition in file ra8_rsip_asym_internal.h.

Function Documentation

◆ internal_asym_pull()

void internal_asym_pull ( ra8_rsip_off_t off,
uint8_t * buf,
uint32_t len )

Pull a byte buffer back through an asymmetric output lane.

Inverse of internal_asym_push: reads whole little-endian 32-bit words from the register at off into buf and unpacks any trailing 1 .. 3 bytes from a final partial word. Defined in ra8_rsip_asym.c; shared with the RSA entry points in ra8_rsip_rsa.c.

Parameters
[in]offRegister offset of the asymmetric output lane.
[out]bufDestination buffer (>= len bytes); never NULL here.
[in]lenNumber of bytes to pull (may be zero).
Precondition
off is a valid ra8_rsip_off_t output-lane offset.
buf points to at least len writable bytes.
Postcondition
buf[0 .. len-1] reflect the engine output in little-endian order.
No state outside the destination buffer is modified.
Note
Internal helper; not exposed in the public header.
Since
0.1.0

References RA8_PRIV.

◆ internal_asym_push()

void internal_asym_push ( ra8_rsip_off_t off,
const uint8_t * buf,
uint32_t len )

Stream a byte buffer into an asymmetric input lane.

Packs whole little-endian 32-bit words into the register at off and zero-extends any trailing 1 .. 3 bytes into a final partial word. Defined in ra8_rsip_asym.c; shared with the RSA entry points in ra8_rsip_rsa.c.

Parameters
[in]offRegister offset of the asymmetric input lane.
[in]bufSource buffer (>= len bytes); never NULL here.
[in]lenNumber of bytes to push (may be zero).
Precondition
off is a valid ra8_rsip_off_t input-lane offset.
Either len is zero or buf is non-NULL.
Postcondition
The engine has observed ceil(len / 4) word writes to off.
No command-word side effect.
Note
Internal helper; not exposed in the public header.
Since
0.1.0

References RA8_PRIV.

◆ internal_zero_handle_tail()

void internal_zero_handle_tail ( ra8_rsip_key_handle_t * handle,
uint32_t words )

Zero-fill the unused tail of a key-handle body buffer.

Several engine paths return a wrapped body shorter than the maximum body capacity. To avoid leaking stale stack contents into the structure, callers pad body[words .. max-1] with zeros. Centralised here and defined in ra8_rsip_asym.c; shared with the key wrap / unwrap + KDF paths there and with the ECDH shared-secret pull in ra8_rsip_ecc.c.

Parameters
[in,out]handleHandle whose body[] tail is wiped; never NULL here.
[in]wordsNumber of words already populated.
Precondition
handle is non-NULL.
words <= k_ra8_rsip_handle_words_rsa4096_priv.
Postcondition
handle->body[w] == 0 for all w in [words, max).
No other field is modified.
Note
Internal helper; not exposed in the public header.
Since
0.1.0

References RA8_PRIV.