Leancrypto 1.6.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

int lc_sym_init (struct lc_sym_ctx *ctx)
 Initialize symmetric context.
int lc_sym_setkey (struct lc_sym_ctx *ctx, const uint8_t *key, size_t keylen)
 Set key.
int lc_sym_setiv (struct lc_sym_ctx *ctx, const uint8_t *iv, size_t ivlen)
 Set IV.
void lc_sym_encrypt (struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out, size_t len)
 Symmetric encryption.
void lc_sym_decrypt (struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out, size_t len)
 Symmetric decryption.
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.
uint64_t lc_sym_algorithm_type (const struct lc_sym *sym)
 Obtain algorithm type usable with lc_alg_status.
uint64_t lc_sym_ctx_algorithm_type (const struct lc_sym_ctx *ctx)
 Obtain algorithm type usable with lc_alg_status.