1 /* Rijndael Block Cipher - rijndael.h 2 3 Written by Mike Scott 21st April 1999 4 mike@compapp.dcu.ie 5 6 Permission for free direct or derivative use is granted subject 7 to compliance with any conditions that the originators of the 8 algorithm place on its exploitation. 9 10 */ 11 #ifndef RIJNDAEL_H 12 #define RIJNDAEL_H 13 14 #include <string.h> 15 #include <stdint.h> 16 #include <stdio.h> 17 #include <glib.h> 18 19 #define u8 uint8_t /* 8 bits */ 20 #define u32 uint32_t /* 32 bits */ 21 #define u64 uint64_t 22 23 /* rotates x one bit to the left */ 24 25 #define ROTL(x) (((x)>>7)|((x)<<1)) 26 27 /* Rotates 32-bit word left by 1, 2 or 3 byte */ 28 29 #define ROTL8(x) (((x)<<8)|((x)>>24)) 30 #define ROTL16(x) (((x)<<16)|((x)>>16)) 31 #define ROTL24(x) (((x)<<24)|((x)>>8)) 32 33 34 G_GNUC_INTERNAL void aes_set_key(u8 *key); 35 G_GNUC_INTERNAL void aes_decrypt(u8 *iv, u8 *inbuf, u8 *outbuf, unsigned long long len); 36 G_GNUC_INTERNAL void aes_encrypt(const u8 *initiv, u8 *inbuf, u8 *outbuf, unsigned long long len); 37 38 #endif 39