00001
00004 #ifndef _AES_H
00005 #define _AES_H
00006
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010
00014 typedef struct
00015 {
00016 unsigned long erk[64];
00017 unsigned long drk[64];
00018 int nr;
00019 }
00020 aes_context;
00021
00029 void aes_set_key( aes_context *ctx, unsigned char *key, int keysize );
00030
00038 void aes_encrypt( aes_context *ctx,
00039 unsigned char input[16],
00040 unsigned char output[16] );
00041
00049 void aes_decrypt( aes_context *ctx,
00050 unsigned char input[16],
00051 unsigned char output[16] );
00052
00062 void aes_cbc_encrypt( aes_context *ctx,
00063 unsigned char iv[16],
00064 unsigned char *input,
00065 unsigned char *output,
00066 int len );
00067
00077 void aes_cbc_decrypt( aes_context *ctx,
00078 unsigned char iv[16],
00079 unsigned char *input,
00080 unsigned char *output,
00081 int len );
00082
00088 int aes_self_test( int verbose );
00089
00090 #ifdef __cplusplus
00091 }
00092 #endif
00093
00094 #endif