Mercurial > libavutil.hg
comparison aes.c @ 195:d36946d9907e libavutil
fix 2 warnings
author | michael |
---|---|
date | Sun, 14 Jan 2007 19:58:41 +0000 |
parents | 3d5efe2de0ae |
children | b1ad10c8f362 |
comparison
equal
deleted
inserted
replaced
194:3d5efe2de0ae | 195:d36946d9907e |
---|---|
97 | 97 |
98 void av_aes_encrypt(AVAES *a){ | 98 void av_aes_encrypt(AVAES *a){ |
99 crypt(a, 2, sbox, enc_multbl); | 99 crypt(a, 2, sbox, enc_multbl); |
100 } | 100 } |
101 | 101 |
102 static init_multbl2(uint8_t tbl[1024], int c[4], uint8_t *log8, uint8_t *alog8, uint8_t *sbox){ | 102 static void init_multbl2(uint8_t tbl[1024], int c[4], uint8_t *log8, uint8_t *alog8, uint8_t *sbox){ |
103 int i; | 103 int i; |
104 for(i=0; i<1024; i++){ | 104 for(i=0; i<1024; i++){ |
105 int x= sbox[i/4]; | 105 int x= sbox[i/4]; |
106 if(x) tbl[i]= alog8[ log8[x] + log8[c[i&3]] ]; | 106 if(x) tbl[i]= alog8[ log8[x] + log8[c[i&3]] ]; |
107 } | 107 } |
190 } | 190 } |
191 | 191 |
192 #ifdef TEST | 192 #ifdef TEST |
193 | 193 |
194 int main(){ | 194 int main(){ |
195 int i,j,k; | 195 int i,j; |
196 AVAES *ae= av_aes_init("PI=3.141592654..", 128, 0); | 196 AVAES *ae= av_aes_init("PI=3.141592654..", 128, 0); |
197 AVAES *ad= av_aes_init("PI=3.141592654..", 128, 1); | 197 AVAES *ad= av_aes_init("PI=3.141592654..", 128, 1); |
198 uint8_t zero[16]= {0}; | 198 uint8_t zero[16]= {0}; |
199 uint8_t pt[16]= {0x6a, 0x84, 0x86, 0x7c, 0xd7, 0x7e, 0x12, 0xad, 0x07, 0xea, 0x1b, 0xe8, 0x95, 0xc5, 0x3f, 0xa3}; | 199 uint8_t pt[16]= {0x6a, 0x84, 0x86, 0x7c, 0xd7, 0x7e, 0x12, 0xad, 0x07, 0xea, 0x1b, 0xe8, 0x95, 0xc5, 0x3f, 0xa3}; |
200 uint8_t ct[16]= {0x73, 0x22, 0x81, 0xc0, 0xa0, 0xaa, 0xb8, 0xf7, 0xa5, 0x4a, 0x0c, 0x67, 0xa0, 0xc4, 0x5e, 0xcf}; | 200 uint8_t ct[16]= {0x73, 0x22, 0x81, 0xc0, 0xa0, 0xaa, 0xb8, 0xf7, 0xa5, 0x4a, 0x0c, 0x67, 0xa0, 0xc4, 0x5e, 0xcf}; |