94typedef enum : uint8_t {
145typedef enum : uint8_t {
159typedef enum : uint8_t {
176typedef enum : uint32_t {
423 const uint8_t* input,
566 const uint8_t* nonce,
570 const uint8_t* plain,
621 const uint8_t* nonce,
625 const uint8_t* cipher,
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_psa_key_usage_t
Bitmask of allowed operations on an imported key.
@ k_ra8_psa_usage_encrypt
Allow ra8_psa_aead_encrypt.
@ k_ra8_psa_usage_derive
Allow KDF-style derivation (future).
@ k_ra8_psa_usage_verify
Allow ra8_psa_verify_hash.
@ k_ra8_psa_usage_none
No usage allowed (placeholder).
@ k_ra8_psa_usage_decrypt
Allow ra8_psa_aead_decrypt.
@ k_ra8_psa_usage_sign
Allow ra8_psa_sign_hash.
ra8_err_t ra8_psa_hash_compute(ra8_psa_alg_t alg, const uint8_t *input, size_t input_len, uint8_t *out, size_t out_cap, size_t *out_len)
Compute a one-shot SHA-256 digest.
ra8_err_t ra8_psa_key_destroy(ra8_psa_key_t handle)
Destroy a previously-imported key.
ra8_err_t ra8_psa_aead_decrypt(ra8_psa_key_t handle, ra8_psa_alg_t alg, const uint8_t *nonce, size_t nonce_len, const uint8_t *aad, size_t aad_len, const uint8_t *cipher, size_t cipher_len, uint8_t *out, size_t out_cap, size_t *out_len)
Decrypt + verify-tag an AES-GCM buffer.
ra8_err_t ra8_psa_crypto_init(void)
One-shot facade initialisation.
ra8_err_t ra8_psa_key_import(ra8_psa_key_t *out_handle, const ra8_psa_key_attr_t *attr, const uint8_t *data, size_t data_len)
Import a raw-byte key into the static pool.
struct ra8_psa_key_handle * ra8_psa_key_t
Opaque PSA key handle (typed pointer into the static pool).
ra8_err_t ra8_psa_verify_hash(ra8_psa_key_t handle, ra8_psa_alg_t alg, const uint8_t *hash, size_t hash_len, const uint8_t *sig, size_t sig_len)
Verify an ECDSA signature over a pre-computed hash.
ra8_err_t ra8_psa_sign_hash(ra8_psa_key_t handle, ra8_psa_alg_t alg, const uint8_t *hash, size_t hash_len, uint8_t *sig, size_t sig_cap, size_t *sig_len)
Sign a pre-computed hash with a private ECDSA key.
ra8_psa_key_type_t
Project-local enum mirroring the PSA key-type families we care about.
@ k_ra8_psa_key_type_ecc_p256_pub
ECDSA P-256 public key (uncompressed).
@ k_ra8_psa_key_type_raw
Raw octet string (HKDF input).
@ k_ra8_psa_key_type_aes
Symmetric AES key.
@ k_ra8_psa_key_type_hmac
HMAC key (any hash).
@ k_ra8_psa_key_type_ecc_p256_priv
ECDSA P-256 private key.
ra8_err_t ra8_psa_crypto_random(uint8_t *out, size_t out_len)
Fill out[0..out_len-1] with cryptographically secure bytes.
ra8_err_t ra8_psa_crypto_deinit(void)
Symmetric tear-down for ra8_psa_crypto_init.
ra8_psa_alg_t
Algorithm selector passed to sign / verify / AEAD operations.
@ k_ra8_psa_alg_none
Sentinel for "unset".
@ k_ra8_psa_alg_ecdsa_sha_256
ECDSA over SHA-256 (FIPS 186-4).
@ k_ra8_psa_alg_aes_gcm
AES-GCM AEAD (NIST SP 800-38D).
@ k_ra8_psa_alg_sha_256
SHA-256 hash (FIPS 180-4).
ra8_psa_limits_t
Static-pool sizing constants for the PSA Crypto facade.
@ k_ra8_psa_max_keys
Maximum simultaneous key handles handed out by the pool.
@ k_ra8_psa_gcm_tag_len
AES-GCM authentication tag length (16 octets).
@ k_ra8_psa_max_key_bytes
Maximum imported raw-key length in bytes (P-384 + AES-256).
@ k_ra8_psa_sha256_len
SHA-256 digest length (RFC 6234, Section 4.1).
@ k_ra8_psa_gcm_nonce_len
AES-GCM nonce length used by ra8_psa_aead_* (NIST SP 800-38D).
@ k_ra8_psa_max_sig_bytes
Maximum ECDSA signature length we ever emit (P-384 raw r||s).
ra8_err_t ra8_psa_aead_encrypt(ra8_psa_key_t handle, ra8_psa_alg_t alg, const uint8_t *nonce, size_t nonce_len, const uint8_t *aad, size_t aad_len, const uint8_t *plain, size_t plain_len, uint8_t *out, size_t out_cap, size_t *out_len)
Encrypt + authenticate a buffer with AES-GCM.
Attributes describing a key being imported.
ra8_psa_alg_t alg
Algorithm the key is permitted to drive.
ra8_psa_key_type_t type
Key type family (AES, ECDSA priv, ...).
ra8_psa_key_usage_t usage
Allowed operations on this key.
Forward declaration of the static-pool slot type.