Moved timing parameters into proc_global_info (XCC)
[akaros.git] / kern / include / random / rijndael.h
1 /*
2  * contrib/pgcrypto/rijndael.h
3  *
4  *      $OpenBSD: rijndael.h,v 1.3 2001/05/09 23:01:32 markus Exp $ */
5
6 /* This is an independent implementation of the encryption algorithm:   */
7 /*                                                                                                                                              */
8 /*                 RIJNDAEL by Joan Daemen and Vincent Rijmen                                   */
9 /*                                                                                                                                              */
10 /* which is a candidate algorithm in the Advanced Encryption Standard   */
11 /* programme of the US National Institute of Standards and Technology.  */
12 /*                                                                                                                                              */
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.             */
17 /*                                                                                                                                              */
18 /* Dr Brian Gladman (gladman@seven77.demon.co.uk) 14th January 1999             */
19
20 typedef struct rijndaelCtx rijndaelCtx;
21
22 struct rijndaelCtx {
23         uint32_t k_len;
24         int decrypt;
25         uint32_t e_key[64];
26         uint32_t d_key[64];
27 };
28
29 /* Standard interface for AES cryptographic routines                            */
30
31 /* These are all based on 32 bit unsigned values and will therefore */
32 /* require endian conversions for big-endian architectures                      */
33
34 rijndaelCtx *rijndael_set_key(rijndaelCtx *, const uint32_t *, const uint32_t,
35                                                           int);
36 void rijndael_encrypt(rijndaelCtx *, const uint32_t *, uint32_t *);
37 void rijndael_decrypt(rijndaelCtx *, const uint32_t *, uint32_t *);
38
39 /* conventional interface */
40
41 void aes_set_key(rijndaelCtx *ctx, const uint8_t *key, unsigned keybits,
42                                  int enc);
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,
46                                          unsigned len);
47 void aes_cbc_decrypt(rijndaelCtx *ctx, uint8_t *iva, uint8_t *data,
48                                          unsigned len);