ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
psa_kat_shim.c File Reference

TEST-ONLY platform shims for the tf-psa-crypto software backend. More...

#include <stddef.h>
#include <stdint.h>
#include "mbedtls/platform_util.h"
#include "psa/crypto.h"
Include dependency graph for psa_kat_shim.c:

Go to the source code of this file.

Enumerations

enum  shim_const_t : uint32_t {
  k_shim_lcg_mul = 1664525U ,
  k_shim_lcg_add = 1013904223U ,
  k_shim_seed = 0x1234ABCDU ,
  k_shim_top_shift = 24U
}
 LCG multiplier (Numerical Recipes) for the deterministic test RNG. More...

Functions

psa_status_t mbedtls_psa_external_get_random (mbedtls_psa_external_random_context_t *context, uint8_t *output, size_t output_size, size_t *output_length)

Detailed Description

TEST-ONLY platform shims for the tf-psa-crypto software backend.

Tag
[Ring 6 / APP] {World: S}

The vendored tf-psa-crypto port config enables MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG, so psa_crypto_init needs an external RNG entry point, and (if MBEDTLS_HAVE_TIME is set) an mbedtls_ms_time. This app is a known-answer test whose operations – SHA-256, AES-128-GCM with a fixed nonce, and ECDSA-P256 verify – draw NO randomness, so a deterministic RNG here does not affect the KAT result. It exists only so psa_crypto_init succeeds.

Warning
NOT cryptographically secure. This deterministic RNG must never ship in a real image; a production build needs a real entropy source (see libs/ra8_hal/src/ra8_rsip.c – the RSIP TRNG needs an FSP port).
Since
0.1.0

Definition in file psa_kat_shim.c.

Enumeration Type Documentation

◆ shim_const_t

enum shim_const_t : uint32_t

LCG multiplier (Numerical Recipes) for the deterministic test RNG.

Enumerator
k_shim_lcg_mul 

Shim lcg mul.

k_shim_lcg_add 

Shim lcg add.

k_shim_seed 

Shim seed.

k_shim_top_shift 

Shim top shift.

Definition at line 32 of file psa_kat_shim.c.

Function Documentation

◆ mbedtls_psa_external_get_random()

psa_status_t mbedtls_psa_external_get_random ( mbedtls_psa_external_random_context_t * context,
uint8_t * output,
size_t output_size,
size_t * output_length )

Definition at line 39 of file psa_kat_shim.c.

References k_shim_lcg_add, k_shim_lcg_mul, k_shim_seed, and k_shim_top_shift.