Leancrypto 0.12.0
Post-Quantum Cryptographic Library
Loading...
Searching...
No Matches
lc_sha256.h File Reference
#include "lc_hash.h"
+ Include dependency graph for lc_sha256.h:

Go to the source code of this file.

Macros

#define LC_SHA256_CTX_ON_STACK(name)
 Allocate stack memory for the SHA256 context without VLA.
 

Variables

const struct lc_hashlc_sha256
 SHA2-256 algorithm reference.
 

Macro Definition Documentation

◆ LC_SHA256_CTX_ON_STACK

#define LC_SHA256_CTX_ON_STACK ( name)
Value:
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wvla\"") _Pragma( \
"GCC diagnostic ignored \"-Wdeclaration-after-statement\"") \
LC_ALIGNED_BUFFER(name##_ctx_buf, LC_SHA256_CTX_SIZE, \
LC_HASH_COMMON_ALIGNMENT); \
struct lc_hash_ctx *name = (struct lc_hash_ctx *)name##_ctx_buf; \
LC_SHA256_CTX(name); \
_Pragma("GCC diagnostic pop")
#define LC_ALIGNED_BUFFER(name, size, alignment)
Allocate aligned stack memory.

Allocate stack memory for the SHA256 context without VLA.

Parameters
[in]nameName of the stack variable

Definition at line 58 of file lc_sha256.h.

Variable Documentation

◆ lc_sha256

const struct lc_hash* lc_sha256
extern

SHA2-256 algorithm reference.