Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rijndael.h
1 /* $OpenBSD: rijndael.h,v 1.15 2021/09/28 11:14:50 dtucker 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 u8 [16], u8 [16]);
42 
43 /* The structure for key information */
44 typedef struct {
45  int decrypt;
46  int Nr; /* key-length-dependent number of rounds */
47  u32 ek[4*(AES_MAXROUNDS + 1)]; /* encrypt key schedule */
48  u32 dk[4*(AES_MAXROUNDS + 1)]; /* decrypt key schedule */
49 } rijndael_ctx;
50 
51 void rijndael_set_key(rijndael_ctx *, u_char *, int, int);
52 void rijndael_decrypt(rijndael_ctx *, u_char *, u_char *);
53 void rijndael_encrypt(rijndael_ctx *, u_char *, u_char *);
54 
55 #endif /* _PRIVATE_RIJNDAEL_H */