1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

simplify sbox init

Originally committed as revision 7461 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2007-01-14 09:14:05 +00:00
parent 3306dfd544
commit 2c3427eb2a

View File

@ -123,9 +123,8 @@ AVAES *av_aes_init(uint8_t *key, int keyBits) {
log8[0]= 255;
for(i=0; i<256; i++){
j= i ? alog8[255-log8[i]] : 0;
j ^= (j<<1) ^ (j<<2) ^ (j<<3) ^ (j<<4)
^(j>>7) ^ (j>>6) ^ (j>>5) ^ (j>>4) ^ 99;
j&=255;
j ^= (j<<1) ^ (j<<2) ^ (j<<3) ^ (j<<4);
j = (j ^ (j>>8) ^ 99) & 255;
inv_sbox[j]= i;
sbox [i]= j;
// av_log(NULL, AV_LOG_ERROR, "%d, ", log8[i]);