Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _RIJNDAEL_H_
00021 #define _RIJNDAEL_H_
00022
00023
00024
00025 typedef uint8 u1byte;
00026 typedef uint16 u2byte;
00027 typedef uint32 u4byte;
00028
00029 typedef int8 s1byte;
00030 typedef int16 s2byte;
00031 typedef int32 s4byte;
00032
00033 typedef struct _rijndael_ctx
00034 {
00035 u4byte k_len;
00036 int decrypt;
00037 u4byte e_key[64];
00038 u4byte d_key[64];
00039 } rijndael_ctx;
00040
00041
00042
00043
00044
00045
00046
00047 rijndael_ctx *
00048 rijndael_set_key(rijndael_ctx *, const u4byte *, const u4byte, int);
00049 void rijndael_encrypt(rijndael_ctx *, const u4byte *, u4byte *);
00050 void rijndael_decrypt(rijndael_ctx *, const u4byte *, u4byte *);
00051
00052
00053
00054 void aes_set_key(rijndael_ctx *ctx, const uint8 *key, unsigned keybits, int enc);
00055 void aes_ecb_encrypt(rijndael_ctx *ctx, uint8 *data, unsigned len);
00056 void aes_ecb_decrypt(rijndael_ctx *ctx, uint8 *data, unsigned len);
00057 void aes_cbc_encrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len);
00058 void aes_cbc_decrypt(rijndael_ctx *ctx, uint8 *iva, uint8 *data, unsigned len);
00059
00060 #endif