46typedef enum : uint32_t {
52typedef enum : uint8_t {
60static const uint8_t
s_msg_two_block[] =
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq";
64 0xE3U, 0xB0U, 0xC4U, 0x42U, 0x98U, 0xFCU, 0x1CU, 0x14U, 0x9AU, 0xFBU, 0xF4U,
65 0xC8U, 0x99U, 0x6FU, 0xB9U, 0x24U, 0x27U, 0xAEU, 0x41U, 0xE4U, 0x64U, 0x9BU,
66 0x93U, 0x4CU, 0xA4U, 0x95U, 0x99U, 0x1BU, 0x78U, 0x52U, 0xB8U, 0x55U,
71 0xBAU, 0x78U, 0x16U, 0xBFU, 0x8FU, 0x01U, 0xCFU, 0xEAU, 0x41U, 0x41U, 0x40U,
72 0xDEU, 0x5DU, 0xAEU, 0x22U, 0x23U, 0xB0U, 0x03U, 0x61U, 0xA3U, 0x96U, 0x17U,
73 0x7AU, 0x9CU, 0xB4U, 0x10U, 0xFFU, 0x61U, 0xF2U, 0x00U, 0x15U, 0xADU,
78 0x24U, 0x8DU, 0x6AU, 0x61U, 0xD2U, 0x06U, 0x38U, 0xB8U, 0xE5U, 0xC0U, 0x26U,
79 0x93U, 0x0CU, 0x3EU, 0x60U, 0x39U, 0xA3U, 0x3CU, 0xE4U, 0x59U, 0x64U, 0xFFU,
80 0x21U, 0x67U, 0xF6U, 0xECU, 0xEDU, 0xD4U, 0x19U, 0xDBU, 0x06U, 0xC1U,
105 __asm__
volatile(
"wfi");
124 uint32_t cpuclk0_hz = 0U;
void main(void)
Secure fallback main entry point.
kat_const_t
Demo tunables.
@ k_kat_period_ms
Kat period ms.
static const uint8_t s_exp_two_block[k_ra8_rsip_sha256_digest_bytes]
Expected SHA-256(56-byte two-block message) – FIPS 180-4.
static bool internal_kat_one(const uint8_t *msg, uint32_t len, const uint8_t *expect)
Hash one message on the RSIP engine and compare to a known answer.
kat_msg_len_t
Length of the 56-byte NIST two-block message (excludes the NUL).
@ k_kat_msg2_len
Kat msg2 length.
static void internal_kat_panic_halt(void)
Park the processor after fatal setup or KAT control-flow failure.
static const uint8_t s_exp_abc[k_ra8_rsip_sha256_digest_bytes]
Expected SHA-256("abc") – FIPS 180-4.
static const uint8_t s_kat_msg_fail[]
HIL verdict emitted after one or more SHA-256 vectors fail.
static const uint8_t s_msg_two_block[]
NIST vector 3 input: the 448-bit two-block message.
static const uint8_t s_msg_abc[]
NIST vector 2 input: "abc".
static const uint8_t s_kat_msg_ok[]
HIL verdict emitted after all SHA-256 vectors pass.
static const uint8_t s_exp_empty[k_ra8_rsip_sha256_digest_bytes]
Expected SHA-256("") – FIPS 180-4.
static void internal_kat_setup_or_halt(void)
Initialize clocks, timing, console, and status LEDs for the KAT.
Annotation-attribute framework macros for ra8-firmware.
#define RA8_INTERNAL
Marker that a function is intended to be static (file-local).
Board-support layer for the Renesas EK-RA8D2 v1 evaluation kit.
ra8_err_t ra8_board_led_toggle(ra8_board_led_id_t led)
Toggle led's output state.
ra8_err_t ra8_board_led_init(ra8_board_led_id_t led)
Configure led as a digital output, initial level low (off).
@ k_ra8_board_led2
LED2, GREEN, P303 (jumper E26).
@ k_ra8_board_led1
LED1, BLUE, P600 (jumper E27).
ra8_err_t ra8_board_uart_console_write(const uint8_t *data, size_t len)
Polled blocking write to the J-Link OB VCOM console.
ra8_err_t ra8_board_uart_console_init(uint32_t baud)
Configure SCI8 + PD02/PD03 as the debug-console UART.
Boot entry points shared between a vector table and its startup code.
High-level Clock Generation Circuit driver.
ra8_err_t ra8_cgc_get_clock_hz(ra8_clock_id_t id, uint32_t *out_hz)
Query the current frequency of a clock-tree domain.
@ k_ra8_clock_id_cpuclk0
Cortex-M85 CPUCLK0.
ra8_err_t ra8_cgc_init(void)
Configure the clock tree to a safe default.
Error Code Definitions for ra8-firmware.
@ k_ra8_ok
Success – operation completed with all postconditions satisfied.
int memcmp(const void *a, const void *b, size_t n)
Compare bytes in two memory areas.
NVIC + ICU IELSR allocator.
void ra8_isr_globals_enable(void)
Globally enable maskable interrupts (PRIMASK = 0).
Renesas Secure IP (RSIP-E50D) HAL – core lifecycle / TRNG / hash API.
ra8_err_t ra8_rsip_sha256(const uint8_t *msg, uint32_t msg_len, uint8_t *digest)
Compute SHA-256 of an in-memory buffer.
@ k_ra8_rsip_sha256_digest_bytes
SHA-256 digest length.
SysTick-based tick counter, delay and timestamp helpers.
ra8_err_t ra8_time_init(uint32_t cpu_hz)
Initialise SysTick for a 1 kHz tick interrupt.
void ra8_delay_ms(uint32_t ms)
Busy-wait for at least ms milliseconds.