Leancrypto 0.12.0
Post-Quantum Cryptographic Library
Loading...
Searching...
No Matches
lc_sym.h File Reference
#include "ext_headers.h"
#include "lc_memset_secure.h"
#include "lc_memory_support.h"
+ Include dependency graph for lc_sym.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LC_SYM_CTX_ON_STACK(name, symname)
 Allocate stack memory for the sym context.
 

Functions

static void lc_sym_init (struct lc_sym_ctx *ctx)
 Initialize symmetric context.
 
static int lc_sym_setkey (struct lc_sym_ctx *ctx, const uint8_t *key, size_t keylen)
 Set key.
 
static int lc_sym_setiv (struct lc_sym_ctx *ctx, const uint8_t *iv, size_t ivlen)
 Set IV.
 
static void lc_sym_encrypt (struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out, size_t len)
 Symmetric encryption.
 
static void lc_sym_decrypt (struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out, size_t len)
 Symmetric decryption.
 
static void lc_sym_zero (struct lc_sym_ctx *ctx)
 Zeroize symmetric context allocated with either LC_SYM_CTX_ON_STACK or lc_sym_alloc.
 
int lc_sym_alloc (const struct lc_sym *sym, struct lc_sym_ctx **ctx)
 Allocate symmetric algorithm context on heap.
 
void lc_sym_zero_free (struct lc_sym_ctx *ctx)
 Symmetric algorithm deallocation and properly zeroization function to frees all buffers and the cipher handle.