ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_rsip_mgmt.h
Go to the documentation of this file.
1
39
40#pragma once
41
42#include <stdint.h>
43
44#include "ra8_err.h"
45#include "ra8_rsip_keys.h"
46#include "ra8_rsip_regs.h"
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52/* =============================================================================
53 * OEM boot loader version (anti-rollback)
54 * =============================================================================
55 */
56
74[[nodiscard]] ra8_err_t ra8_rsip_oem_bl_version_get(uint32_t* out);
75
97
113[[nodiscard]] ra8_err_t ra8_rsip_oem_bl_version_lock(void);
114
115/* =============================================================================
116 * Wrapped-key vault
117 * =============================================================================
118 */
119
140[[nodiscard]] ra8_err_t ra8_rsip_kv_read(uint8_t slot, uint8_t* out);
141
162[[nodiscard]] ra8_err_t ra8_rsip_kv_write(uint8_t slot, const uint8_t* in);
163
182[[nodiscard]] ra8_err_t ra8_rsip_kv_erase(uint8_t slot);
183
201[[nodiscard]] ra8_err_t ra8_rsip_kv_count(uint32_t* out);
202
203/* =============================================================================
204 * Key wrap / unwrap engine
205 * =============================================================================
206 */
207
228[[nodiscard]] ra8_err_t ra8_rsip_key_wrap(const ra8_rsip_key_handle_t* kek,
229 const uint8_t* iv,
230 const ra8_rsip_key_handle_t* src,
231 uint8_t* blob);
232
255 const uint8_t* iv,
256 const uint8_t* blob,
258
259/* =============================================================================
260 * Key Derivation Function
261 * =============================================================================
262 */
263
300 const ra8_rsip_key_handle_t* ikm,
301 const uint8_t* label,
302 uint32_t label_len,
303 const uint8_t* salt,
304 uint32_t salt_len,
305 uint32_t out_len,
307
308/* =============================================================================
309 * Device lifecycle + debug authorisation
310 * =============================================================================
311 */
312
331
356
375
393
394/* =============================================================================
395 * Tamper subsystem
396 * =============================================================================
397 */
398
416[[nodiscard]] ra8_err_t ra8_rsip_tamper_enable(uint32_t sources);
417
435[[nodiscard]] ra8_err_t ra8_rsip_tamper_status(uint32_t* out);
436
453[[nodiscard]] ra8_err_t ra8_rsip_tamper_ack(uint32_t mask);
454
471[[nodiscard]] ra8_err_t ra8_rsip_dpa_arm(bool enable);
472
473/* =============================================================================
474 * DOTF key delivery routing
475 * =============================================================================
476 */
477
497[[nodiscard]] ra8_err_t ra8_rsip_dotf_route(uint8_t which, uint8_t slot, bool on);
498
499#ifdef __cplusplus
500}
501#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
Renesas Secure IP (RSIP-E50D) HAL – key install + cipher / hash API.
ra8_err_t ra8_rsip_kv_erase(uint8_t slot)
Zeroise a vault slot.
ra8_err_t ra8_rsip_oem_bl_version_increment(void)
Increment the OEM boot loader version (anti-rollback step).
ra8_err_t ra8_rsip_debug_level_get(ra8_rsip_debug_level_t *out)
Read the current debug authorisation level.
ra8_err_t ra8_rsip_tamper_ack(uint32_t mask)
Acknowledge tamper-source flags (write-1-to-clear).
ra8_err_t ra8_rsip_life_advance(ra8_rsip_life_state_t state)
Advance the device lifecycle to a new state.
ra8_err_t ra8_rsip_tamper_enable(uint32_t sources)
Enable or disable a set of tamper sources.
ra8_err_t ra8_rsip_key_wrap(const ra8_rsip_key_handle_t *kek, const uint8_t *iv, const ra8_rsip_key_handle_t *src, uint8_t *blob)
Wrap a key handle into a transportable blob using a KEK.
ra8_err_t ra8_rsip_kv_count(uint32_t *out)
Snapshot the populated-slot count.
ra8_err_t ra8_rsip_kv_write(uint8_t slot, const uint8_t *in)
Write a wrapped-key blob into a vault slot.
ra8_err_t ra8_rsip_tamper_status(uint32_t *out)
Read latched tamper-source flags.
ra8_err_t ra8_rsip_dotf_route(uint8_t which, uint8_t slot, bool on)
Route a wrapped-key vault slot to one of the DOTF instances.
ra8_err_t ra8_rsip_kv_read(uint8_t slot, uint8_t *out)
Read a wrapped-key blob from a vault slot.
ra8_err_t ra8_rsip_oem_bl_version_lock(void)
Latch the OEM_BL_LOCK so further increments are rejected.
ra8_err_t ra8_rsip_debug_level_set(ra8_rsip_debug_level_t level)
Set the debug authorisation level.
ra8_err_t ra8_rsip_oem_bl_version_get(uint32_t *out)
Read the latched OEM boot loader version counter.
ra8_err_t ra8_rsip_dpa_arm(bool enable)
Arm or disarm SPA / DPA countermeasures.
ra8_err_t ra8_rsip_kdf(ra8_rsip_kdf_op_t op, const ra8_rsip_key_handle_t *ikm, const uint8_t *label, uint32_t label_len, const uint8_t *salt, uint32_t salt_len, uint32_t out_len, ra8_rsip_key_handle_t *out)
Derive a key from input keying material + label/salt/info.
ra8_err_t ra8_rsip_key_unwrap(const ra8_rsip_key_handle_t *kek, const uint8_t *iv, const uint8_t *blob, ra8_rsip_key_handle_t *dest)
Unwrap a transportable blob into a key handle.
ra8_err_t ra8_rsip_life_get(ra8_rsip_life_state_t *out)
Read the device-lifecycle state.
Renesas Secure IP (RSIP-E50D) register layout for the RA8D2.
ra8_rsip_kdf_op_t
KDF mode selector written to KDF_CTRL.
ra8_rsip_debug_level_t
Debug authorisation levels AL0/AL1/AL2 (off-target-only model – no documented RA8D2 register; real st...
ra8_rsip_life_state_t
Device-lifecycle state values (off-target-only model – no documented RA8D2 register; real state is in...
Opaque wrapped-key handle.