8 #ifndef __PS_CRYPTO_INTERFACE_H__
9 #define __PS_CRYPTO_INTERFACE_H__
20 #define PS_KEY_LEN_BYTES 16
21 #define PS_TAG_LEN_BYTES 16
22 #define PS_IV_LEN_BYTES 12
psa_status_t ps_crypto_authenticate(const union ps_crypto_t *crypto, const uint8_t *add, uint32_t add_len)
Authenticate given data against the tag.
void ps_crypto_get_iv(union ps_crypto_t *crypto)
Gets a new IV value into the crypto union.
psa_status_t ps_crypto_generate_auth_tag(union ps_crypto_t *crypto, const uint8_t *add, uint32_t add_len)
Generates authentication tag for given data.
struct ps_crypto_t::@9 ref
psa_status_t ps_crypto_destroykey(void)
Destroys the transient key used for crypto operations.
psa_status_t ps_crypto_encrypt_and_tag(union ps_crypto_t *crypto, const uint8_t *add, size_t add_len, const uint8_t *in, size_t in_len, uint8_t *out, size_t out_size, size_t *out_len)
Encrypts and tags the given plaintext data.
psa_status_t ps_crypto_init(void)
Initializes the crypto engine.
void ps_crypto_set_iv(const union ps_crypto_t *crypto)
Provides current IV value to crypto layer.
psa_status_t ps_crypto_setkey(void)
Sets the key to use for crypto operations for the current client.
int32_t psa_status_t
Function return status.
psa_status_t ps_crypto_auth_and_decrypt(const union ps_crypto_t *crypto, const uint8_t *add, size_t add_len, uint8_t *in, size_t in_len, uint8_t *out, size_t out_size, size_t *out_len)
Decrypts and authenticates the given encrypted data.