blob: 09c4257423dba71fc5192f070f836df67a79feec [file] [log] [blame]
Ben Lindstromfa1b3d02000-12-10 01:55:37 +00001#ifndef _RIJNDAEL_H_
2#define _RIJNDAEL_H_
Damien Miller874d77b2000-10-14 16:23:11 +11003
Ben Lindstromfa1b3d02000-12-10 01:55:37 +00004#include "config.h"
Damien Miller59939352000-10-15 12:21:32 +11005
Ben Lindstromfa1b3d02000-12-10 01:55:37 +00006/* 1. Standard types for AES cryptography source code */
Damien Miller874d77b2000-10-14 16:23:11 +11007
Ben Lindstromfa1b3d02000-12-10 01:55:37 +00008typedef u_int8_t u1byte; /* an 8 bit unsigned character type */
9typedef u_int16_t u2byte; /* a 16 bit unsigned integer type */
10typedef u_int32_t u4byte; /* a 32 bit unsigned integer type */
Damien Miller874d77b2000-10-14 16:23:11 +110011
Ben Lindstromfa1b3d02000-12-10 01:55:37 +000012typedef int8_t s1byte; /* an 8 bit signed character type */
13typedef int16_t s2byte; /* a 16 bit signed integer type */
14typedef int32_t s4byte; /* a 32 bit signed integer type */
Damien Miller874d77b2000-10-14 16:23:11 +110015
Ben Lindstromfa1b3d02000-12-10 01:55:37 +000016typedef struct _rijndael_ctx {
17 u4byte k_len;
18 int decrypt;
19 u4byte e_key[64];
20 u4byte d_key[64];
21} rijndael_ctx;
Damien Miller874d77b2000-10-14 16:23:11 +110022
Ben Lindstromfa1b3d02000-12-10 01:55:37 +000023
24/* 2. Standard interface for AES cryptographic routines */
25
26/* These are all based on 32 bit unsigned values and will therefore */
27/* require endian conversions for big-endian architectures */
28
29rijndael_ctx *rijndael_set_key __P((rijndael_ctx *, const u4byte *, u4byte, int));
30void rijndael_encrypt __P((rijndael_ctx *, const u4byte *, u4byte *));
31void rijndael_decrypt __P((rijndael_ctx *, const u4byte *, u4byte *));
32
33#endif /* _RIJNDAEL_H_ */