diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-01-14 09:14:05 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-01-14 09:14:05 +0000 |
commit | 2c3427eb2a37818e7792e3530537e6cecc7defb5 (patch) | |
tree | ae6ba436aa8a6112d47bfab14bba390acfb566c0 /libavutil/aes.c | |
parent | 3306dfd5442db03f058485a22a4b4c7146942f11 (diff) | |
download | ffmpeg-2c3427eb2a37818e7792e3530537e6cecc7defb5.tar.gz |
simplify sbox init
Originally committed as revision 7461 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/aes.c')
-rw-r--r-- | libavutil/aes.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/libavutil/aes.c b/libavutil/aes.c index 05f3581360..07485167b8 100644 --- a/libavutil/aes.c +++ b/libavutil/aes.c @@ -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]); |