22#ifndef PROTOCORE_AES128GCM_H
23#define PROTOCORE_AES128GCM_H
28#if (PC_ENABLE_HTTP3 || PC_ENABLE_DTLS || PC_ENABLE_SMB)
35#define PC_AES128GCM_KEY_LEN 16
37#define PC_AES128GCM_IV_LEN 12
39#define PC_AES128GCM_TAG_LEN 16
58pc_aes128 *pc_aes128_wants(
void);
61void pc_aes128_init(pc_aes128 *ctx,
const uint8_t key[16]);
64void pc_aes128_encrypt_block(pc_aes128 *ctx,
const uint8_t in[16], uint8_t out[16]);
67void pc_aes128_wipe(pc_aes128 *ctx);
86struct pc_aes128gcm_key;
96pc_aes128gcm_key *pc_aes128gcm_key_init(
void *storage,
const uint8_t key[PC_AES128GCM_KEY_LEN]);
99void pc_aes128gcm_key_wipe(pc_aes128gcm_key *k);
110pc_cspan pc_aes128gcm_seal(pc_aes128gcm_key *k,
const uint8_t nonce[PC_AES128GCM_IV_LEN],
const uint8_t *aad,
111 size_t aad_len,
const uint8_t *pt,
size_t pt_len, uint8_t *ct_out,
112 uint8_t tag_out[PC_AES128GCM_TAG_LEN]);
121bool pc_aes128gcm_open(pc_aes128gcm_key *k,
const uint8_t nonce[PC_AES128GCM_IV_LEN],
const uint8_t *aad,
122 size_t aad_len,
const uint8_t *ct,
size_t ct_len,
const uint8_t tag[PC_AES128GCM_TAG_LEN],
User-facing configuration for ProtoCore.
A byte region whose run length is bound in both directions.