2 * contrib/pgcrypto/rijndael.h
4 * $OpenBSD: rijndael.h,v 1.3 2001/05/09 23:01:32 markus Exp $ */
6 /* This is an independent implementation of the encryption algorithm: */
8 /* RIJNDAEL by Joan Daemen and Vincent Rijmen */
10 /* which is a candidate algorithm in the Advanced Encryption Standard */
11 /* programme of the US National Institute of Standards and Technology. */
13 /* Copyright in this implementation is held by Dr B R Gladman but I */
14 /* hereby give permission for its free direct or derivative use subject */
15 /* to acknowledgment of its origin and compliance with any conditions */
16 /* that the originators of the algorithm place on its exploitation. */
18 /* Dr Brian Gladman (gladman@seven77.demon.co.uk) 14th January 1999 */
20 typedef struct rijndaelCtx rijndaelCtx;
29 /* Standard interface for AES cryptographic routines */
31 /* These are all based on 32 bit unsigned values and will therefore */
32 /* require endian conversions for big-endian architectures */
34 rijndaelCtx *rijndael_set_key(rijndaelCtx *, const uint32_t *, const uint32_t,
36 void rijndael_encrypt(rijndaelCtx *, const uint32_t *, uint32_t *);
37 void rijndael_decrypt(rijndaelCtx *, const uint32_t *, uint32_t *);
39 /* conventional interface */
41 void aes_set_key(rijndaelCtx *ctx, const uint8_t *key, unsigned keybits,
43 void aes_ecb_encrypt(rijndaelCtx *ctx, uint8_t *data, unsigned len);
44 void aes_ecb_decrypt(rijndaelCtx *ctx, uint8_t *data, unsigned len);
45 void aes_cbc_encrypt(rijndaelCtx *ctx, uint8_t *iva, uint8_t *data,
47 void aes_cbc_decrypt(rijndaelCtx *ctx, uint8_t *iva, uint8_t *data,