Grid Community Toolkit  6.2.1653033972 (tag: v6.2.20220524)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rijndael.h
1 /* $OpenBSD: rijndael.h,v 1.14 2014/04/29 15:42:07 markus Exp $ */
2 
28 #ifndef _PRIVATE_RIJNDAEL_H
29 #define _PRIVATE_RIJNDAEL_H
30 
31 #define AES_MAXKEYBITS (256)
32 #define AES_MAXKEYBYTES (AES_MAXKEYBITS/8)
33 /* for 256-bit keys, fewer for less */
34 #define AES_MAXROUNDS 14
35 
36 typedef unsigned char u8;
37 typedef unsigned short u16;
38 typedef unsigned int u32;
39 
40 int rijndaelKeySetupEnc(unsigned int [], const unsigned char [], int);
41 void rijndaelEncrypt(const unsigned int [], int, const unsigned char [],
42  unsigned char []);
43 
44 /* The structure for key information */
45 typedef struct {
46  int decrypt;
47  int Nr; /* key-length-dependent number of rounds */
48  u32 ek[4*(AES_MAXROUNDS + 1)]; /* encrypt key schedule */
49  u32 dk[4*(AES_MAXROUNDS + 1)]; /* decrypt key schedule */
50 } rijndael_ctx;
51 
52 void rijndael_set_key(rijndael_ctx *, u_char *, int, int);
53 void rijndael_decrypt(rijndael_ctx *, u_char *, u_char *);
54 void rijndael_encrypt(rijndael_ctx *, u_char *, u_char *);
55 
56 #endif /* _PRIVATE_RIJNDAEL_H */