|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Renesas Secure IP (RSIP-E50D) HAL – vault / KDF / lifecycle / tamper. More...
Go to the source code of this file.
Functions | |
| 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_oem_bl_version_increment (void) |
| Increment the OEM boot loader version (anti-rollback step). | |
| 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_kv_read (uint8_t slot, uint8_t *out) |
| Read a wrapped-key blob from a vault slot. | |
| 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_kv_erase (uint8_t slot) |
| Zeroise a vault slot. | |
| ra8_err_t | ra8_rsip_kv_count (uint32_t *out) |
| Snapshot the populated-slot count. | |
| 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_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_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_life_get (ra8_rsip_life_state_t *out) |
| Read the device-lifecycle state. | |
| 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_debug_level_get (ra8_rsip_debug_level_t *out) |
| Read the current debug authorisation level. | |
| ra8_err_t | ra8_rsip_debug_level_set (ra8_rsip_debug_level_t level) |
| Set the debug authorisation level. | |
| ra8_err_t | ra8_rsip_tamper_enable (uint32_t sources) |
| Enable or disable a set of tamper sources. | |
| ra8_err_t | ra8_rsip_tamper_status (uint32_t *out) |
| Read latched tamper-source flags. | |
| ra8_err_t | ra8_rsip_tamper_ack (uint32_t mask) |
| Acknowledge tamper-source flags (write-1-to-clear). | |
| ra8_err_t | ra8_rsip_dpa_arm (bool enable) |
| Arm or disarm SPA / DPA countermeasures. | |
| 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. | |
Renesas Secure IP (RSIP-E50D) HAL – vault / KDF / lifecycle / tamper.
Device-management surface of the RA8D2 RSIP-E50D HAL split out of the ra8_rsip.h umbrella. This sub-header owns the OEM boot loader version anti-rollback counter, the wrapped-key vault slots, the KEK-backed key wrap / unwrap engine, the HKDF / HUK-UID key derivation function, the device lifecycle + debug-authorisation helpers, the tamper subsystem, and the DOTF key-delivery routing.
Wrap / unwrap and KDF consume the opaque ra8_rsip_key_handle_t type defined in ra8_rsip_keys.h, which this sub-header includes.
Definition in file ra8_rsip_mgmt.h.
|
nodiscard |
Read the current debug authorisation level.
| [out] | out | Receives the level (AL0/AL1/AL2). |
| k_ra8_ok | Snapshot returned. |
| k_ra8_err_null_ptr | out was NULL. |
Definition at line 199 of file ra8_rsip_devsec.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Set the debug authorisation level.
| [in] | level | Target level. |
| k_ra8_ok | Level applied. |
| k_ra8_err_invalid_arg | level out of range. |
Definition at line 205 of file ra8_rsip_devsec.c.
References k_ra8_err_not_supported.
|
nodiscard |
Route a wrapped-key vault slot to one of the DOTF instances.
| [in] | which | DOTF instance (0 or 1). |
| [in] | slot | Vault slot to feed (must contain an AES key). |
| [in] | on | true to enable the route, false to disable. |
| k_ra8_ok | Route applied. |
| k_ra8_err_invalid_arg | which not 0/1 or slot out of range. |
Definition at line 747 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported.
|
nodiscard |
Arm or disarm SPA / DPA countermeasures.
| [in] | enable | true to arm, false to disarm. |
| k_ra8_ok | Done. |
Definition at line 229 of file ra8_rsip_devsec.c.
References k_ra8_err_not_supported.
|
nodiscard |
Derive a key from input keying material + label/salt/info.
Implements:
| [in] | op | KDF mode selector. |
| [in] | ikm | Input keying material handle (may be NULL for HUK / UID modes). |
| [in] | label | Label / context bytes. |
| [in] | label_len | Label length in bytes. |
| [in] | salt | Salt bytes (may be NULL). |
| [in] | salt_len | Salt length in bytes. |
| [in] | out_len | Bytes of derived material requested. |
| [out] | out | Wrapped derived-key handle. |
| k_ra8_ok | Handle filled. |
| k_ra8_err_null_ptr | out was NULL or label/ikm missing where required. |
| k_ra8_err_invalid_arg | out_len zero or larger than the hash's max XOF length. |
| k_ra8_err_hw_timeout | Engine never signalled KDF_DONE. |
Definition at line 727 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Unwrap a transportable blob into a key handle.
| [in] | kek | Key-encryption-key handle. |
| [in] | iv | 16-byte wrap IV used at wrap time. |
| [in] | blob | Wrapped blob (64 bytes). |
| [out] | dest | Destination key handle. |
| k_ra8_ok | Handle filled. |
| k_ra8_err_null_ptr | Any pointer was NULL. |
| k_ra8_err_hw_timeout | Engine never signalled DONE. |
| k_ra8_err_hw_error | Blob authenticity check failed. |
Definition at line 715 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Wrap a key handle into a transportable blob using a KEK.
| [in] | kek | Key-encryption-key handle. |
| [in] | iv | 16-byte wrap IV. |
| [in] | src | Source key handle to wrap. |
| [out] | blob | Wrapped blob output (64 bytes). |
| k_ra8_ok | Blob produced. |
| k_ra8_err_null_ptr | Any pointer was NULL. |
| k_ra8_err_hw_timeout | Engine never signalled DONE. |
Definition at line 703 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Snapshot the populated-slot count.
| [out] | out | Receives the count (0..16); never NULL. |
| k_ra8_ok | Count returned. |
| k_ra8_err_null_ptr | out was NULL. |
Definition at line 697 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Zeroise a vault slot.
| [in] | slot | Slot index. |
| k_ra8_ok | Slot erased. |
| k_ra8_err_invalid_arg | slot out of range. |
| k_ra8_err_hw_timeout | Engine never signalled DONE. |
Definition at line 691 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported.
|
nodiscard |
Read a wrapped-key blob from a vault slot.
| [in] | slot | Slot index (0..k_ra8_rsip_kv_slot_count-1). |
| [out] | out | 64-byte buffer to receive the wrapped blob. |
| k_ra8_ok | Blob returned. |
| k_ra8_err_invalid_arg | slot out of range. |
| k_ra8_err_null_ptr | out was NULL. |
| k_ra8_err_not_found | Slot is empty. |
| k_ra8_err_hw_timeout | Engine never signalled DONE. |
Definition at line 677 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Write a wrapped-key blob into a vault slot.
| [in] | slot | Slot index. |
| [in] | in | 64-byte wrapped blob. |
| k_ra8_ok | Slot written. |
| k_ra8_err_invalid_arg | slot out of range. |
| k_ra8_err_null_ptr | in was NULL. |
| k_ra8_err_hw_timeout | Engine never signalled DONE. |
Definition at line 684 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Advance the device lifecycle to a new state.
Lifecycle transitions are one-way (HUM Ch 51.1 p 3263). The engine rejects backward moves with k_ra8_err_invalid_state.
| [in] | state | Target lifecycle state. |
| k_ra8_ok | Transition complete. |
| k_ra8_err_invalid_arg | Unknown state. |
| k_ra8_err_invalid_state | Transition would move backward. |
| k_ra8_err_hw_timeout | Engine never signalled DONE. |
Definition at line 193 of file ra8_rsip_devsec.c.
References k_ra8_err_not_supported.
|
nodiscard |
Read the device-lifecycle state.
| [out] | out | Receives the lifecycle word. |
| k_ra8_ok | Snapshot returned. |
| k_ra8_err_null_ptr | out was NULL. |
Definition at line 187 of file ra8_rsip_devsec.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Read the latched OEM boot loader version counter.
| [out] | out | Receives the 32-bit counter; never NULL. |
| k_ra8_ok | Snapshot returned. |
| k_ra8_err_null_ptr | out was NULL. |
Definition at line 661 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.
|
nodiscard |
Increment the OEM boot loader version (anti-rollback step).
Writes the inc-trigger word; the engine increments the counter monotonically. The lock register MUST be set after a successful boot to prevent further increments mid-flight.
| k_ra8_ok | Counter advanced. |
| k_ra8_err_invalid_state | OEM_BL_LOCK already latched. |
Definition at line 667 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported.
|
nodiscard |
Latch the OEM_BL_LOCK so further increments are rejected.
| k_ra8_ok | Lock latched. |
Definition at line 672 of file ra8_rsip_asym.c.
References k_ra8_err_not_supported.
|
nodiscard |
Acknowledge tamper-source flags (write-1-to-clear).
| [in] | mask | Bits to clear. |
| k_ra8_ok | Bits cleared. |
| k_ra8_err_invalid_arg | mask had bits outside the field. |
Definition at line 223 of file ra8_rsip_devsec.c.
References k_ra8_err_not_supported.
|
nodiscard |
Enable or disable a set of tamper sources.
| [in] | sources | OR of k_ra8_rsip_tamper_src_* bits to enable. |
| k_ra8_ok | Mask applied. |
| k_ra8_err_invalid_arg | sources has bits outside the documented mask. |
Definition at line 211 of file ra8_rsip_devsec.c.
References k_ra8_err_not_supported.
|
nodiscard |
Read latched tamper-source flags.
| [out] | out | Receives the flag word. |
| k_ra8_ok | Snapshot returned. |
| k_ra8_err_null_ptr | out was NULL. |
Definition at line 217 of file ra8_rsip_devsec.c.
References k_ra8_err_not_supported, RA8_CHECK_NULL_PTR, and s_tag.