Go to the source code of this file.
|
#define | LC_HC_CTX_ON_STACK(name, hash) |
| Allocate stack memory for the hash cryptor context.
|
|
|
static size_t | lc_hc_get_tagsize (struct lc_hc_cryptor *hc) |
| Return maximum size of authentication tag.
|
|
int | lc_hc_alloc (const struct lc_hash *hash, struct lc_aead_ctx **ctx) |
| Allocate Hash cryptor context on heap.
|
|
◆ LC_HC_CTX_ON_STACK
#define LC_HC_CTX_ON_STACK |
( |
| name, |
|
|
| hash ) |
Value: _Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wvla\"") _Pragma( \
"GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \
LC_HC_CTX_SIZE(hash), \
LC_HASH_COMMON_ALIGNMENT); \
struct lc_aead_ctx *name = (struct lc_aead_ctx *)name##_ctx_buf; \
LC_HC_SET_CTX(name, hash); \
lc_aead_zero(name); \
_Pragma("GCC diagnostic pop")
#define LC_ALIGNED_BUFFER(name, size, alignment)
Allocate aligned stack memory.
Allocate stack memory for the hash cryptor context.
- Parameters
-
[in] | name | Name of the stack variable |
[in] | hash | Hash implementation of type struct hash used for the HMAC authentication |
Definition at line 101 of file lc_hash_crypt.h.
◆ lc_hc_alloc()
int lc_hc_alloc |
( |
const struct lc_hash * | hash, |
|
|
struct lc_aead_ctx ** | ctx ) |
Allocate Hash cryptor context on heap.
- Parameters
-
[in] | hash | Hash implementation of type struct hash used for the HMAC authentication |
[out] | ctx | Allocated hash cryptor context |
- Returns
- 0 on success, < 0 on error
◆ lc_hc_get_tagsize()
static size_t lc_hc_get_tagsize |
( |
struct lc_hc_cryptor * | hc | ) |
|
|
inlinestatic |
Return maximum size of authentication tag.
- Parameters
-
[in] | hc | Hash cryptor context handle |
- Returns
- size of tag
Definition at line 76 of file lc_hash_crypt.h.