Leancrypto 1.7.2
Post-Quantum Cryptographic Library
Macros | Functions
lc_sym.h File Reference
#include "ext_headers.h"
#include "lc_memset_secure.h"
#include "lc_memory_support.h"
#include "lc_status.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. More...
 

Functions

int lc_sym_init (struct lc_sym_ctx *ctx)
 Initialize symmetric context. More...
 
int lc_sym_setkey (struct lc_sym_ctx *ctx, const uint8_t *key, size_t keylen)
 Set key. More...
 
int lc_sym_setiv (struct lc_sym_ctx *ctx, const uint8_t *iv, size_t ivlen)
 Set IV. More...
 
int lc_sym_getiv (const struct lc_sym_ctx *ctx, uint8_t *iv, size_t ivlen)
 Get IV. More...
 
void lc_sym_encrypt (struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out, size_t len)
 Symmetric encryption. More...
 
void lc_sym_decrypt (struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out, size_t len)
 Symmetric decryption. More...
 
void lc_sym_zero (struct lc_sym_ctx *ctx)
 Zeroize symmetric context allocated with either LC_SYM_CTX_ON_STACK or lc_sym_alloc. More...
 
int lc_sym_alloc (const struct lc_sym *sym, struct lc_sym_ctx **ctx)
 Allocate symmetric algorithm context on heap. More...
 
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. More...
 
enum lc_alg_status_val lc_sym_alg_status (const struct lc_sym *sym)
 Obtain algorithm status. More...
 
enum lc_alg_status_val lc_sym_ctx_alg_status (const struct lc_sym_ctx *ctx)
 Obtain algorithm status. More...