NetBurner 3.5.8
PDF Version
Toggle main menu visibility
aes.h
1
/*NB_REVISION*/
2
3
/*
4
* FIPS-197 compliant AES implementation
5
*
6
* Copyright (C) 2006-2007 Christophe Devine
7
*
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License, version 2.1 as published by the Free Software Foundation.
11
*
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
* MA 02110-1301 USA
21
*/
22
23
/*
24
* @file aes.h
25
* @brief Advanced Encryption Standard
26
*/
27
34
35
36
37
#ifndef _AES_H
38
#define _AES_H
39
43
typedef
struct
44
{
45
unsigned
long
erk
[64];
46
unsigned
long
drk
[64];
47
int
nr
;
48
}
aes_context
;
49
57
void
aes_set_key
(
aes_context
*ctx,
const
unsigned
char
*key,
int
keysize);
58
66
void
aes_encrypt
(
aes_context
*ctx,
unsigned
char
input[16],
unsigned
char
output[16]);
67
75
void
aes_decrypt
(
aes_context
*ctx,
unsigned
char
input[16],
unsigned
char
output[16]);
76
86
void
aes_cbc_encrypt
(
aes_context
*ctx,
unsigned
char
iv[16],
unsigned
char
*input,
unsigned
char
*output,
int
len);
87
97
void
aes_cbc_decrypt
(
aes_context
*ctx,
unsigned
char
iv[16],
unsigned
char
*input,
unsigned
char
*output,
int
len);
98
104
int
aes_self_test
(
int
verbose);
105
106
#endif
/* aes.h */
107
aes_encrypt
void aes_encrypt(aes_context *ctx, unsigned char input[16], unsigned char output[16])
AES block encryption (ECB mode).
aes_self_test
int aes_self_test(int verbose)
Checkup routine.
Definition
aes/src/main.cpp:33
aes_decrypt
void aes_decrypt(aes_context *ctx, unsigned char input[16], unsigned char output[16])
AES block decryption (ECB mode).
aes_cbc_encrypt
void aes_cbc_encrypt(aes_context *ctx, unsigned char iv[16], unsigned char *input, unsigned char *output, int len)
AES-CBC buffer encryption.
aes_cbc_decrypt
void aes_cbc_decrypt(aes_context *ctx, unsigned char iv[16], unsigned char *input, unsigned char *output, int len)
AES-CBC buffer decryption.
aes_set_key
void aes_set_key(aes_context *ctx, const unsigned char *key, int keysize)
AES key schedule.
aes_context
AES context structure.
Definition
aes.h:44
aes_context::erk
unsigned long erk[64]
Definition
aes.h:45
aes_context::nr
int nr
Definition
aes.h:47
aes_context::drk
unsigned long drk[64]
Definition
aes.h:46
nbrtos
include
aes.h
Generated by
1.18.0