1
/* $OpenBSD: rijndael.h,v 1.3 2001/05/09 23:01:32 markus Exp $ */
3
/* This is an independent implementation of the encryption algorithm: */
5
/* RIJNDAEL by Joan Daemen and Vincent Rijmen */
7
/* which is a candidate algorithm in the Advanced Encryption Standard */
8
/* programme of the US National Institute of Standards and Technology. */
10
/* Copyright in this implementation is held by Dr B R Gladman but I */
11
/* hereby give permission for its free direct or derivative use subject */
12
/* to acknowledgment of its origin and compliance with any conditions */
13
/* that the originators of the algorithm place on its exploitation. */
15
/* Dr Brian Gladman (gladman@seven77.demon.co.uk) 14th January 1999 */
20
/* 1. Standard types for AES cryptography source code */
22
typedef uint8 u1byte; /* an 8 bit unsigned character type */
23
typedef uint16 u2byte; /* a 16 bit unsigned integer type */
24
typedef uint32 u4byte; /* a 32 bit unsigned integer type */
26
typedef int8 s1byte; /* an 8 bit signed character type */
27
typedef int16 s2byte; /* a 16 bit signed integer type */
28
typedef int32 s4byte; /* a 32 bit signed integer type */
30
typedef struct _rijndael_ctx
39
/* 2. Standard interface for AES cryptographic routines */
41
/* These are all based on 32 bit unsigned values and will therefore */
42
/* require endian conversions for big-endian architectures */
45
rijndael_set_key(rijndael_ctx *, const u4byte *, const u4byte, int);
46
void rijndael_encrypt(rijndael_ctx *, const u4byte *, u4byte *);
47
void rijndael_decrypt(rijndael_ctx *, const u4byte *, u4byte *);
49
/* conventional interface */
51
void aes_set_key(rijndael_ctx * ctx, const uint8 *key, unsigned keybits, int enc);
52
void aes_ecb_encrypt(rijndael_ctx * ctx, uint8 *data, unsigned len);
53
void aes_ecb_decrypt(rijndael_ctx * ctx, uint8 *data, unsigned len);
54
void aes_cbc_encrypt(rijndael_ctx * ctx, uint8 *iva, uint8 *data, unsigned len);
55
void aes_cbc_decrypt(rijndael_ctx * ctx, uint8 *iva, uint8 *data, unsigned len);
57
#endif /* _RIJNDAEL_H_ */