Bitcoin ABC  0.22.12
P2P Digital Currency
ctaes.h
Go to the documentation of this file.
1 /**********************************************************************
2  * Copyright (c) 2016 Pieter Wuille *
3  * Distributed under the MIT software license, see the accompanying *
4  * file COPYING or http://www.opensource.org/licenses/mit-license.php.*
5  **********************************************************************/
6 
7 #ifndef _CTAES_H_
8 #define _CTAES_H_ 1
9 
10 #include <stdint.h>
11 #include <stdlib.h>
12 
13 typedef struct {
14  uint16_t slice[8];
15 } AES_state;
16 
17 typedef struct {
18  AES_state rk[11];
19 } AES128_ctx;
20 
21 typedef struct {
22  AES_state rk[13];
23 } AES192_ctx;
24 
25 typedef struct {
26  AES_state rk[15];
27 } AES256_ctx;
28 
29 void AES128_init(AES128_ctx *ctx, const uint8_t *key16);
30 void AES128_encrypt(const AES128_ctx *ctx, size_t blocks, uint8_t *cipher16,
31  const uint8_t *plain16);
32 void AES128_decrypt(const AES128_ctx *ctx, size_t blocks, uint8_t *plain16,
33  const uint8_t *cipher16);
34 
35 void AES192_init(AES192_ctx *ctx, const uint8_t *key24);
36 void AES192_encrypt(const AES192_ctx *ctx, size_t blocks, uint8_t *cipher16,
37  const uint8_t *plain16);
38 void AES192_decrypt(const AES192_ctx *ctx, size_t blocks, uint8_t *plain16,
39  const uint8_t *cipher16);
40 
41 void AES256_init(AES256_ctx *ctx, const uint8_t *key32);
42 void AES256_encrypt(const AES256_ctx *ctx, size_t blocks, uint8_t *cipher16,
43  const uint8_t *plain16);
44 void AES256_decrypt(const AES256_ctx *ctx, size_t blocks, uint8_t *plain16,
45  const uint8_t *cipher16);
46 
47 #endif
secp256k1_context * ctx
void AES256_encrypt(const AES256_ctx *ctx, size_t blocks, uint8_t *cipher16, const uint8_t *plain16)
Definition: ctaes.c:566
void AES256_decrypt(const AES256_ctx *ctx, size_t blocks, uint8_t *plain16, const uint8_t *cipher16)
Definition: ctaes.c:575
void AES128_decrypt(const AES128_ctx *ctx, size_t blocks, uint8_t *plain16, const uint8_t *cipher16)
Definition: ctaes.c:531
void AES256_init(AES256_ctx *ctx, const uint8_t *key32)
Definition: ctaes.c:562
void AES192_encrypt(const AES192_ctx *ctx, size_t blocks, uint8_t *cipher16, const uint8_t *plain16)
Definition: ctaes.c:544
void AES192_init(AES192_ctx *ctx, const uint8_t *key24)
Definition: ctaes.c:540
void AES128_encrypt(const AES128_ctx *ctx, size_t blocks, uint8_t *cipher16, const uint8_t *plain16)
Definition: ctaes.c:522
void AES192_decrypt(const AES192_ctx *ctx, size_t blocks, uint8_t *plain16, const uint8_t *cipher16)
Definition: ctaes.c:553
void AES128_init(AES128_ctx *ctx, const uint8_t *key16)
Definition: ctaes.c:518