Go to the source code of this file.
◆ LC_AK_CTX_ON_STACK
| #define LC_AK_CTX_ON_STACK |
( |
|
name, |
|
|
|
hash |
|
) |
| |
Value: _Pragma("GCC diagnostic push") _Pragma( \
"GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \
LC_ASCON_ALIGNMENT); \
struct lc_aead_ctx *name = (struct lc_aead_ctx *)name##_ctx_buf; \
LC_ASCON_SET_CTX(name, hash, lc_ascon_keccak_aead); \
struct lc_ascon_cryptor *__name_ascon_crypto = name->aead_state; \
__name_ascon_crypto->statesize = LC_SHA3_STATE_SIZE; \
__name_ascon_crypto->taglen = 16; \
_Pragma("GCC diagnostic pop")
#define LC_ALIGNED_BUFFER(name, size, alignment)
Allocate aligned stack memory.
Allocate stack memory for the Ascon-Keccak cryptor context using a 128 bit tag.
- Note
- This is defined for lc_sha3_512 and lc_sha3_256.
- Parameters
-
| [in] | name | Name of the stack variable |
| [in] | hash | Hash implementation of type struct hash used for the Ascon-Keccak algorithm |
Definition at line 82 of file lc_ascon_keccak.h.
◆ LC_AK_CTX_ON_STACK_TAGLEN
| #define LC_AK_CTX_ON_STACK_TAGLEN |
( |
|
name, |
|
|
|
hash, |
|
|
|
tagsize |
|
) |
| |
Value: _Pragma("GCC diagnostic push") _Pragma( \
"GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \
LC_ASCON_ALIGNMENT); \
struct lc_aead_ctx *name = (struct lc_aead_ctx *)name##_ctx_buf; \
LC_ASCON_SET_CTX(name, hash, lc_ascon_keccak_aead); \
struct lc_ascon_cryptor *__name_ascon_crypto = name->aead_state; \
__name_ascon_crypto->statesize = LC_SHA3_STATE_SIZE; \
__name_ascon_crypto->taglen = tagsize; \
_Pragma("GCC diagnostic pop")
Allocate stack memory for the Ascon-Keccak cryptor context using a configured taglen.
- Note
- This is defined for lc_sha3_512 and lc_sha3_256.
- Parameters
-
| [in] | name | Name of the stack variable |
| [in] | hash | Hash implementation of type struct hash used for the Ascon-Keccak algorithm |
| [in] | tagsize | Length of the tag in bytes (between 16 and key size) |
Definition at line 105 of file lc_ascon_keccak.h.
◆ lc_ak_alloc()
| int lc_ak_alloc |
( |
const struct lc_hash * |
hash, |
|
|
struct lc_aead_ctx ** |
ctx |
|
) |
| |
Allocate Ascon Keccak cryptor context on heap.
This allocation ensures the tag length to be 128 bits.
- Note
- This is defined for lc_sha3_512 and lc_sha3_256.
- Parameters
-
| [in] | hash | Hash implementation of type struct hash used for the Ascon-Keccak algorithm |
| [out] | ctx | Allocated Ascon-Keccak cryptor context |
- Returns
- 0 on success, < 0 on error
◆ lc_ak_alloc_taglen()
| int lc_ak_alloc_taglen |
( |
const struct lc_hash * |
hash, |
|
|
uint8_t |
taglen, |
|
|
struct lc_aead_ctx ** |
ctx |
|
) |
| |
Allocate Ascon Keccak cryptor context on heap.
This allocation ensures the tag length requested by the caller.
- Note
- This is defined for lc_sha3_512 and lc_sha3_256.
- Parameters
-
| [in] | hash | Hash implementation of type struct hash used for the Ascon-Keccak algorithm |
| [in] | taglen | Length of the tag in bytes (between 16 and key size) |
| [out] | ctx | Allocated Ascon-Keccak cryptor context |
- Returns
- 0 on success, < 0 on error
◆ lc_ascon_keccak_aead
| const struct lc_aead* lc_ascon_keccak_aead |
|
extern |