]>
Commit | Line | Data |
---|---|---|
23c2a7a5 | 1 | /* $OpenBSD: rijndael.h,v 1.6 2001/01/29 01:58:17 niklas Exp $ */ |
2 | ||
6b523bae | 3 | #ifndef _RIJNDAEL_H_ |
4 | #define _RIJNDAEL_H_ | |
94ec8c6b | 5 | |
6b523bae | 6 | #include "config.h" |
4d670c24 | 7 | |
6b523bae | 8 | /* 1. Standard types for AES cryptography source code */ |
94ec8c6b | 9 | |
6b523bae | 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 */ | |
94ec8c6b | 13 | |
6b523bae | 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 */ | |
94ec8c6b | 17 | |
6b523bae | 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; | |
94ec8c6b | 24 | |
6b523bae | 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_ */ |