Ben Lindstrom | 36579d3 | 2001-01-29 07:39:26 +0000 | [diff] [blame] | 1 | /* $OpenBSD: rijndael.h,v 1.6 2001/01/29 01:58:17 niklas Exp $ */ |
| 2 | |
Ben Lindstrom | fa1b3d0 | 2000-12-10 01:55:37 +0000 | [diff] [blame] | 3 | #ifndef _RIJNDAEL_H_ |
| 4 | #define _RIJNDAEL_H_ |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 5 | |
Ben Lindstrom | fa1b3d0 | 2000-12-10 01:55:37 +0000 | [diff] [blame] | 6 | #include "config.h" |
Damien Miller | 5993935 | 2000-10-15 12:21:32 +1100 | [diff] [blame] | 7 | |
Ben Lindstrom | fa1b3d0 | 2000-12-10 01:55:37 +0000 | [diff] [blame] | 8 | /* 1. Standard types for AES cryptography source code */ |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 9 | |
Ben Lindstrom | fa1b3d0 | 2000-12-10 01:55:37 +0000 | [diff] [blame] | 10 | typedef u_int8_t u1byte; /* an 8 bit unsigned character type */ |
| 11 | typedef u_int16_t u2byte; /* a 16 bit unsigned integer type */ |
| 12 | typedef u_int32_t u4byte; /* a 32 bit unsigned integer type */ |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 13 | |
Ben Lindstrom | fa1b3d0 | 2000-12-10 01:55:37 +0000 | [diff] [blame] | 14 | typedef int8_t s1byte; /* an 8 bit signed character type */ |
| 15 | typedef int16_t s2byte; /* a 16 bit signed integer type */ |
| 16 | typedef int32_t s4byte; /* a 32 bit signed integer type */ |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 17 | |
Ben Lindstrom | fa1b3d0 | 2000-12-10 01:55:37 +0000 | [diff] [blame] | 18 | typedef struct _rijndael_ctx { |
| 19 | u4byte k_len; |
| 20 | int decrypt; |
| 21 | u4byte e_key[64]; |
| 22 | u4byte d_key[64]; |
| 23 | } rijndael_ctx; |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 24 | |
Ben Lindstrom | fa1b3d0 | 2000-12-10 01:55:37 +0000 | [diff] [blame] | 25 | |
| 26 | /* 2. Standard interface for AES cryptographic routines */ |
| 27 | |
| 28 | /* These are all based on 32 bit unsigned values and will therefore */ |
| 29 | /* require endian conversions for big-endian architectures */ |
| 30 | |
| 31 | rijndael_ctx *rijndael_set_key __P((rijndael_ctx *, const u4byte *, u4byte, int)); |
| 32 | void rijndael_encrypt __P((rijndael_ctx *, const u4byte *, u4byte *)); |
| 33 | void rijndael_decrypt __P((rijndael_ctx *, const u4byte *, u4byte *)); |
| 34 | |
| 35 | #endif /* _RIJNDAEL_H_ */ |