blob: 01b342eb78e58d7374b5b15ac2e23424f4eb056e [file] [log] [blame]
Ben Lindstrom36579d32001-01-29 07:39:26 +00001/* $OpenBSD: rijndael.h,v 1.6 2001/01/29 01:58:17 niklas Exp $ */
2
Ben Lindstromfa1b3d02000-12-10 01:55:37 +00003#ifndef _RIJNDAEL_H_
4#define _RIJNDAEL_H_
Damien Miller874d77b2000-10-14 16:23:11 +11005
Ben Lindstromfa1b3d02000-12-10 01:55:37 +00006#include "config.h"
Damien Miller59939352000-10-15 12:21:32 +11007
Ben Lindstromfa1b3d02000-12-10 01:55:37 +00008/* 1. Standard types for AES cryptography source code */
Damien Miller874d77b2000-10-14 16:23:11 +11009
Ben Lindstromfa1b3d02000-12-10 01:55:37 +000010typedef u_int8_t u1byte; /* an 8 bit unsigned character type */
11typedef u_int16_t u2byte; /* a 16 bit unsigned integer type */
12typedef u_int32_t u4byte; /* a 32 bit unsigned integer type */
Damien Miller874d77b2000-10-14 16:23:11 +110013
Ben Lindstromfa1b3d02000-12-10 01:55:37 +000014typedef int8_t s1byte; /* an 8 bit signed character type */
15typedef int16_t s2byte; /* a 16 bit signed integer type */
16typedef int32_t s4byte; /* a 32 bit signed integer type */
Damien Miller874d77b2000-10-14 16:23:11 +110017
Ben Lindstromfa1b3d02000-12-10 01:55:37 +000018typedef struct _rijndael_ctx {
19 u4byte k_len;
20 int decrypt;
21 u4byte e_key[64];
22 u4byte d_key[64];
23} rijndael_ctx;
Damien Miller874d77b2000-10-14 16:23:11 +110024
Ben Lindstromfa1b3d02000-12-10 01:55:37 +000025
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
31rijndael_ctx *rijndael_set_key __P((rijndael_ctx *, const u4byte *, u4byte, int));
32void rijndael_encrypt __P((rijndael_ctx *, const u4byte *, u4byte *));
33void rijndael_decrypt __P((rijndael_ctx *, const u4byte *, u4byte *));
34
35#endif /* _RIJNDAEL_H_ */