Go to the source code of this file.
◆ LC_CHACHA20_POLY1305_CTX_ON_STACK
| #define LC_CHACHA20_POLY1305_CTX_ON_STACK |
( |
| name | ) |
|
Value: _Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wvla\"") _Pragma( \
"GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \
LC_CHACHA20_POLY1305_CTX_SIZE, \
LC_MEM_COMMON_ALIGNMENT); \
struct lc_aead_ctx *name = (struct lc_aead_ctx *)name##_ctx_buf; \
LC_CHACHA20_POLY1305_SET_CTX(name); \
lc_aead_zero(name); \
_Pragma("GCC diagnostic pop")
#define LC_ALIGNED_BUFFER(name, size, alignment)
Allocate aligned stack memory.
Allocate stack memory for the ChaCha20 Poly1305 cryptor context.
- Parameters
-
| [in] | name | Name of the stack variable |
Definition at line 75 of file lc_chacha20_poly1305.h.
◆ lc_chacha20_poly1305_alloc()
| int lc_chacha20_poly1305_alloc |
( |
struct lc_aead_ctx ** | ctx | ) |
|
Allocate ChaCha20 Poly1305 cryptor context on heap.
- Parameters
-
| [out] | ctx | Allocated ChaCha20 Poly1305 cryptor context |
- Returns
- 0 on success, < 0 on error