Commit 9cbbf0fe authored by michael's avatar michael

simplify sbox init


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7461 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent a79b2573
......@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment