4#ifndef PROTOCORE_AESCCM_H
5#define PROTOCORE_AESCCM_H
41#define PROTOCORE_AESCCM_TAG_LEN 16
46 proto_bool (*seal)(uint8_t *,
const uint8_t *, size_t,
const uint8_t *, size_t,
const uint8_t *, size_t,
47 const uint8_t *, size_t, uint8_t *, uint8_t *);
48 proto_bool (*open)(uint8_t *,
const uint8_t *, size_t,
const uint8_t *, size_t,
const uint8_t *, size_t,
49 const uint8_t *, size_t,
const uint8_t *, uint8_t *);
69 size_t nonce_len,
const uint8_t *aad,
size_t aad_len,
const uint8_t *pt,
70 size_t pt_len, uint8_t *ct_out, uint8_t *tag_out);
87 size_t nonce_len,
const uint8_t *aad,
size_t aad_len,
const uint8_t *ct,
88 size_t ct_len,
const uint8_t *tag, uint8_t *out);
PROTOCORE_NS AesCcmNs AesCcm PROTOCORE_UNUSED
Module namespace.
proto_bool protocore_aes_ccm_open(uint8_t *work, const uint8_t *key, size_t key_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *aad, size_t aad_len, const uint8_t *ct, size_t ct_len, const uint8_t *tag, uint8_t *out)
Decrypt from A1, recompute the tag over the recovered plaintext, compare it in.
proto_bool protocore_aes_ccm_seal(uint8_t *work, const uint8_t *key, size_t key_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *aad, size_t aad_len, const uint8_t *pt, size_t pt_len, uint8_t *ct_out, uint8_t *tag_out)
CBC-MAC the record, encrypt the payload from A1, write the detached tag.
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
Dispatch table. Addressed by offset, so the layout is asserted below.
proto_bool(* seal)(uint8_t *, const uint8_t *, size_t, const uint8_t *, size_t, const uint8_t *, size_t, const uint8_t *, size_t, uint8_t *, uint8_t *)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS