]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/builddeps/dp.linux32/include/d0_blind_id/d0_rijndael.h
d0_blind_id: update for linux32
[xonotic/xonotic.git] / misc / builddeps / dp.linux32 / include / d0_blind_id / d0_rijndael.h
1 // from http://www.efgh.com/software/rijndael.htm (public domain)
2
3 #ifndef H__RIJNDAEL
4 #define H__RIJNDAEL
5
6 #include "d0.h"
7
8 D0_EXPORT int d0_rijndael_setup_encrypt(unsigned long *rk, const unsigned char *key,
9   int keybits);
10 D0_EXPORT int d0_rijndael_setup_decrypt(unsigned long *rk, const unsigned char *key,
11   int keybits);
12 D0_EXPORT void d0_rijndael_encrypt(const unsigned long *rk, int nrounds,
13   const unsigned char plaintext[16], unsigned char ciphertext[16]);
14 D0_EXPORT void d0_rijndael_decrypt(const unsigned long *rk, int nrounds,
15   const unsigned char ciphertext[16], unsigned char plaintext[16]);
16
17 #define D0_RIJNDAEL_KEYLENGTH(keybits) ((keybits)/8)
18 #define D0_RIJNDAEL_RKLENGTH(keybits)  ((keybits)/8+28)
19 #define D0_RIJNDAEL_NROUNDS(keybits)   ((keybits)/32+6)
20
21 #endif