ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_rsip_key_injection.h
Go to the documentation of this file.
1
37
38#pragma once
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44#include <stdint.h>
45
46#include "ra8_err.h"
47#include "ra8_rsip.h"
48#include "ra8_rsip_regs.h"
49
76
94
106
142[[nodiscard]] ra8_err_t ra8_rsip_key_inject_aes(uint8_t* installed_key_buf,
143 const uint8_t* raw_key,
144 ra8_rsip_aes_key_bits_t key_bits);
145
180[[nodiscard]] ra8_err_t ra8_rsip_key_inject_rsa(uint8_t* installed_key_buf,
181 const uint8_t* raw_modulus,
182 const uint8_t* raw_exponent,
184
216[[nodiscard]] ra8_err_t ra8_rsip_key_inject_ecc(uint8_t* installed_key_buf,
217 ra8_rsip_curve_t curve,
218 const uint8_t* raw_priv_or_pub,
219 bool is_private);
220
249[[nodiscard]] ra8_err_t ra8_rsip_key_validate(const uint8_t* installed_key_buf,
250 ra8_rsip_wrapped_key_type_t expected_type);
251
252#ifdef __cplusplus
253}
254#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 driver – public API.
ra8_rsip_wrapped_key_type_t
Type tag stored in the leading 4 bytes of a wrapped blob.
@ k_ra8_rsip_wrapped_type_ecc_pub
ECC public blob.
@ k_ra8_rsip_wrapped_type_rsa_pub
RSA public blob.
@ k_ra8_rsip_wrapped_type_rsa_priv
RSA private blob.
@ k_ra8_rsip_wrapped_type_ecc_priv
ECC private blob.
@ k_ra8_rsip_wrapped_type_aes
AES key blob.
ra8_err_t ra8_rsip_key_inject_rsa(uint8_t *installed_key_buf, const uint8_t *raw_modulus, const uint8_t *raw_exponent, ra8_rsip_rsa_size_t size)
Wrap a raw RSA key (modulus + exponent) into the installed-key format.
ra8_err_t ra8_rsip_key_validate(const uint8_t *installed_key_buf, ra8_rsip_wrapped_key_type_t expected_type)
Validate that a wrapped-key blob has the expected structure and a matching trailing MAC.
ra8_err_t ra8_rsip_key_inject_aes(uint8_t *installed_key_buf, const uint8_t *raw_key, ra8_rsip_aes_key_bits_t key_bits)
Wrap a raw AES key into the RSIP installed-key format.
ra8_rsip_wrapped_key_const_t
Sizing constants for RSIP wrapped-key blobs.
@ k_ra8_rsip_wrapped_type_bytes
Wrapped-blob type tag.
@ k_ra8_rsip_wrapped_max_payload
Largest key payload (RSA-4096).
@ k_ra8_rsip_wrapped_max_total
Largest wrapped blob in bytes.
@ k_ra8_rsip_wrapped_mac_bytes
Trailing integrity MAC.
@ k_ra8_rsip_wrapped_mgmt_info_bytes
Key-injection envelope.
ra8_rsip_aes_key_bits_t
AES key-width selector accepted by ra8_rsip_key_inject_aes.
@ k_ra8_rsip_aes_key_bits_256
AES-256.
@ k_ra8_rsip_aes_key_bits_128
AES-128.
@ k_ra8_rsip_aes_key_bits_192
AES-192.
ra8_err_t ra8_rsip_key_inject_ecc(uint8_t *installed_key_buf, ra8_rsip_curve_t curve, const uint8_t *raw_priv_or_pub, bool is_private)
Wrap a raw ECC scalar (private or public) into the installed-key format.
Renesas Secure IP (RSIP-E50D) register layout for the RA8D2.
ra8_rsip_curve_t
ECC curve selector (HUM Ch 52.1 Table 52.1 "ECC" p 3302).
ra8_rsip_rsa_size_t
RSA key-size selector (HUM Ch 52.1 Table 52.1 "RSA" p 3302).