18 #if defined(HAVE_AES_SIV)
25 #define AES_SIV_MAX_KEY_LEN (32)
26 #define AES_SIV_KEY_NUMBER (2)
27 #define AES_SIV_TAG_LEN (16)
33 typedef struct _cx_aes_siv_context {
34 uint8_t key1[AES_SIV_MAX_KEY_LEN];
35 uint8_t key2[AES_SIV_MAX_KEY_LEN];
37 uint8_t tag_state[CX_AES_BLOCK_SIZE];
43 } cx_aes_siv_context_t;
56 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_init(cx_aes_siv_context_t *ctx);
67 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_reset(cx_aes_siv_context_t *ctx);
85 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_set_key(cx_aes_siv_context_t *ctx,
101 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_start(cx_aes_siv_context_t *ctx,
114 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_update_aad(cx_aes_siv_context_t *ctx,
118 cx_err_t cx_aes_siv_update_mac(cx_aes_siv_context_t *ctx,
const uint8_t *input,
size_t in_len);
130 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_update(cx_aes_siv_context_t *ctx,
146 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_finish(cx_aes_siv_context_t *ctx,
165 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_encrypt(cx_aes_siv_context_t *ctx,
187 WARN_UNUSED_RESULT cx_err_t cx_aes_siv_decrypt(cx_aes_siv_context_t *ctx,