diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-01-14 19:02:59 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-01-14 19:02:59 +0000 |
commit | 54b78b2495200a1378cff27f62dd746970ef7beb (patch) | |
tree | 96865a87e299f910dc072059d7dc718799bd5cfe /libavutil/aes.c | |
parent | cc8589705566a506cf63da87196b2e9c1aa0488e (diff) | |
download | ffmpeg-54b78b2495200a1378cff27f62dd746970ef7beb.tar.gz |
make decode look more like encode
Originally committed as revision 7491 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/aes.c')
-rw-r--r-- | libavutil/aes.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavutil/aes.c b/libavutil/aes.c index f33170df55..3b9e60125f 100644 --- a/libavutil/aes.c +++ b/libavutil/aes.c @@ -75,14 +75,14 @@ static inline void mix(uint8_t state[4][4], uint32_t multbl[4][256]){ void av_aes_decrypt(AVAES *a){ int t, r; - addkey(a->state, a->round_dec_key[a->rounds]); - for(r=a->rounds-2; r>=0; r--){ + for(r=a->rounds; r>1; r--){ + addkey(a->state, a->round_dec_key[r]); SUBSHIFT3x((a->state[0]+1)) SUBSHIFT2x((a->state[0]+2)) SUBSHIFT1x((a->state[0]+3)) mix(a->state, dec_multbl); - addkey(a->state, a->round_dec_key[r+1]); } + addkey(a->state, a->round_dec_key[1]); SUBSHIFT0((a->state[0]+0), inv_sbox) SUBSHIFT3((a->state[0]+1), inv_sbox) SUBSHIFT2((a->state[0]+2), inv_sbox) |