changeset 215:2f388c3535e5 libavutil

avoid memcpy()
author michael
date Tue, 16 Jan 2007 17:58:11 +0000
parents db327a8aa282
children 1c3c3b1b9596
files aes.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/aes.c	Tue Jan 16 17:51:54 2007 +0000
+++ b/aes.c	Tue Jan 16 17:58:11 2007 +0000
@@ -172,10 +172,9 @@
 
     if(decrypt){
         for(i=1; i<rounds; i++){
-            uint8_t tmp[2][16];
-            memcpy(tmp[1], a->round_key[i][0], 16);
-            subshift(tmp[0], 0, sbox);
-            memcpy(tmp[1], tmp[0], 16);
+            uint8_t tmp[3][16];
+            memcpy(tmp[2], a->round_key[i][0], 16);
+            subshift(tmp[1], 0, sbox);
             mix(tmp, dec_multbl, 1, 3);
             memcpy(a->round_key[i][0], tmp[0], 16);
         }