[Ffmpeg-cvslog] r7500 - trunk/libavutil/aes.c

michael subversion
Sun Jan 14 22:13:15 CET 2007


Author: michael
Date: Sun Jan 14 22:13:14 2007
New Revision: 7500

Modified:
   trunk/libavutil/aes.c

Log:
revert simplification (broke 192 bit keys)


Modified: trunk/libavutil/aes.c
==============================================================================
--- trunk/libavutil/aes.c	(original)
+++ trunk/libavutil/aes.c	Sun Jan 14 22:13:14 2007
@@ -158,9 +158,7 @@
     memcpy(tk, key, KC*4);
 
     for(t= 0; t < (rounds+1)*4;) {
-        if(decrypt) memcpy(a->round_key[0     ][ t], tk, KC*4);
-        else        memcpy(a->round_key[rounds][-t], tk, KC*4);
-
+        memcpy(a->round_key[0][t], tk, KC*4);
         t+= KC;
 
         for(i = 0; i < 4; i++)
@@ -181,6 +179,11 @@
                 a->round_key[i][0][j]= sbox[a->round_key[i][0][j]];
             mix(a->round_key[i], dec_multbl);
         }
+    }else{
+        for(i=0; i<(rounds+1)/2; i++){
+            for(j=0; j<16; j++)
+                FFSWAP(int, a->round_key[i][0][j], a->round_key[rounds-i][0][j]);
+        }
     }
 
     return a;




More information about the ffmpeg-cvslog mailing list