Leancrypto 0.12.0
Post-Quantum Cryptographic Library
Loading...
Searching...
No Matches
lc_aes.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 - 2024, Stephan Mueller <smueller@chronox.de>
3 *
4 * License: see LICENSE file in root directory
5 *
6 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
7 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
8 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ALL OF
9 * WHICH ARE HEREBY DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE
10 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
11 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
12 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
13 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
14 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
16 * USE OF THIS SOFTWARE, EVEN IF NOT ADVISED OF THE POSSIBILITY OF SUCH
17 * DAMAGE.
18 */
19/*
20 * This code is derived in parts from the code distribution provided with
21 * https://github.com/kokke/tiny-AES-c
22 *
23 * This is free and unencumbered software released into the public domain.
24 */
25
26#ifndef LC_AES_H
27#define LC_AES_H
28
29#include "lc_sym.h"
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
35/* AES ECB mode */
36extern const struct lc_sym *lc_aes_ecb;
37
38/* AES CBC mode */
39extern const struct lc_sym *lc_aes_cbc;
40
41/* AES CTR mode */
42extern const struct lc_sym *lc_aes_ctr;
43
44/* AES KW mode */
45extern const struct lc_sym *lc_aes_kw;
46
66void lc_aes_kw_encrypt(struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out,
67 size_t len);
68
89int lc_aes_kw_decrypt(struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out,
90 size_t len);
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif /* LC_AES_H */
void lc_aes_kw_encrypt(struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out, size_t len)
AES KW encrypt.
int lc_aes_kw_decrypt(struct lc_sym_ctx *ctx, const uint8_t *in, uint8_t *out, size_t len)
AES KW decrypt.
const struct lc_sym * lc_aes_cbc
const struct lc_sym * lc_aes_ecb
const struct lc_sym * lc_aes_kw
const struct lc_sym * lc_aes_ctr