128typedef enum : uint32_t {
148typedef enum : uint8_t {
446 const uint32_t* iv_words);
ra8_err_t ra8_dotf_deinit(void)
Disable DOTF and gate the OSPI clock.
ra8_err_t ra8_dotf_exit_stop(void)
Bring the DOTF block back from low-power mode.
ra8_err_t ra8_dotf_close(void)
Tear down DOTF and release all hardware state.
ra8_err_t ra8_dotf_clear_status(uint8_t channel)
Clear REG00 (force the channel into bypass).
void ra8_dotf_dispatch(uint8_t channel)
Dispatch a DOTF event from the IRQ glue.
ra8_err_t ra8_dotf_enter_stop(void)
Park the DOTF block prior to entering a low-power mode.
ra8_err_t ra8_dotf_open(const ra8_dotf_open_cfg_t *cfg)
One-shot DOTF bring-up: init + install_key + set_iv + set_region (+ enable).
ra8_err_t ra8_dotf_set_sca_level(uint8_t channel, ra8_dotf_sca_level_t level)
Update the side-channel countermeasure level for a channel.
ra8_err_t ra8_dotf_enable(uint8_t channel)
Enable AES decryption for one channel.
ra8_dotf_key_size_t
AES key sizes supported by the DOTF AES core.
@ k_ra8_dotf_key_size_128
128-bit AES.
@ k_ra8_dotf_key_size_192
192-bit AES.
@ k_ra8_dotf_key_size_256
256-bit AES.
ra8_err_t ra8_dotf_attach_handler(ra8_dotf_event_fn_t fn, void *ctx)
Register a fault / event callback (shared across both channels).
ra8_err_t ra8_dotf_set_region_window(uint8_t channel, uint32_t start, uint32_t len)
Stage a region from a (start, length) pair instead of a struct.
ra8_err_t ra8_dotf_get_status(uint8_t channel, uint32_t *out_mask)
Read REG00 (raw control / status snapshot).
ra8_err_t ra8_dotf_disable(uint8_t channel)
Disable AES decryption for one channel (transparent bypass).
ra8_err_t ra8_dotf_install_key(uint8_t channel, const ra8_dotf_key_handle_t *handle)
Bind a wrapped AES key handle to a DOTF channel.
ra8_err_t ra8_dotf_rotate_key(uint8_t channel, const ra8_dotf_key_handle_t *new_handle, const uint32_t *iv_words)
Atomically rotate the key bound to a channel.
ra8_err_t ra8_dotf_select_region(uint8_t channel, uint8_t region_id)
Promote a staged region into the live CONVAREAST / CONVAREAD pair.
ra8_err_t ra8_dotf_set_iv(uint8_t channel, const uint32_t *iv_words)
Stage the AES counter-mode IV for a channel via REG03.
ra8_err_t ra8_dotf_set_key_size(uint8_t channel, ra8_dotf_key_size_t size)
Update the cached AES key size for a channel.
ra8_err_t ra8_dotf_init(void)
Power on the DOTF block and reset both channels.
void(* ra8_dotf_event_fn_t)(void *ctx, uint8_t channel)
DOTF fault / status event callback.
ra8_err_t ra8_dotf_run_self_test(uint8_t channel, uint32_t *out_status)
Trigger the built-in self-test (REG00 bit 20) for a channel.
ra8_err_t ra8_dotf_get_active_region(uint8_t channel, ra8_dotf_region_t *region)
Read back the active region for a channel.
ra8_dotf_sca_level_t
Side-channel countermeasure tuning levels.
@ k_ra8_dotf_sca_max
Maximum level, bits 16 + 17 set.
@ k_ra8_dotf_sca_standard
Default level, bit 16 set.
@ k_ra8_dotf_sca_off
Side-channel countermeasures disabled.
ra8_err_t ra8_dotf_set_region(uint8_t channel, const ra8_dotf_region_t *region)
Stage one DOTF region in the channel's region table.
Decryption On The Fly (DOTF) register layout for the Renesas RA8D2.
@ k_ra8_dotf_reg00_key_size_128
Key size = 128-bit (FSP dflt).
@ k_ra8_dotf_reg00_key_size_192
Key size = 192-bit.
@ k_ra8_dotf_reg00_key_size_256
Key size = 256-bit.
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Wrapped-key handle handed to DOTF by ra8_rsip.
ra8_dotf_key_size_t size
128 / 192 / 256 selector for REG00.
uint32_t words[8]
Wrapped-key payload (up to 256 bits).
uint8_t valid
Non-zero if the wrapped key is real.
uint8_t key_index
RSIP key slot this handle came from.
One-shot DOTF bring-up descriptor consumed by ra8_dotf_open.
bool enable_after
true => arm AES after staging.
uint32_t iv_words[4]
128-bit IV in word order.
ra8_dotf_sca_level_t sca_level
Side-channel level.
uint8_t channel
0 = DOTF0, 1 = DOTF1.
ra8_dotf_key_handle_t key
RSIP-wrapped key handle.
ra8_dotf_region_t region
Initial conversion region.
Conversion-area descriptor for ra8_dotf_set_region.
uint8_t region_id
0..k_ra8_dotf_max_regions-1 staging slot.
uint32_t start_addr
First byte of the encrypted region (incl).
uint8_t key_index
RSIP key index (forwarded to install_key flow).
uint32_t end_addr
Last byte of the encrypted region (incl).