NetBurner 3.1
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  * \file aes.h
24  */
25 #ifndef _AES_H
26 #define _AES_H
27 
31 typedef struct
32 {
33  unsigned long erk[64];
34  unsigned long drk[64];
35  int nr;
36 } aes_context;
37 
45 void aes_set_key(aes_context *ctx, const unsigned char *key, int keysize);
46 
54 void aes_encrypt(aes_context *ctx, unsigned char input[16], unsigned char output[16]);
55 
63 void aes_decrypt(aes_context *ctx, unsigned char input[16], unsigned char output[16]);
64 
74 void aes_cbc_encrypt(aes_context *ctx, unsigned char iv[16], unsigned char *input, unsigned char *output, int len);
75 
85 void aes_cbc_decrypt(aes_context *ctx, unsigned char iv[16], unsigned char *input, unsigned char *output, int len);
86 
92 int aes_self_test(int verbose);
93 
94 #endif /* aes.h */
AES context structure.
Definition: aes.h:31
int nr
Definition: aes.h:35