aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-07-02 17:33:45 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2010-07-02 17:33:45 +0000
commit19c039ee3db6ab8b60957cefaef05792ef314786 (patch)
treec609b147d60de1a191dea549904982d74f5ce5d4
parent961b0c41b95268e8f5bf4e75a795043f20567ff1 (diff)
downloadffmpeg-19c039ee3db6ab8b60957cefaef05792ef314786.tar.gz
Make mix function more readable.
Compiler output unchanged with gcc 4.4. Originally committed as revision 24006 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavutil/aes.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libavutil/aes.c b/libavutil/aes.c
index 58654233d7..66cf926a14 100644
--- a/libavutil/aes.c
+++ b/libavutil/aes.c
@@ -78,10 +78,11 @@ static inline int mix_core(uint32_t multbl[][256], int a, int b, int c, int d){
}
static inline void mix(av_aes_block state[2], uint32_t multbl[][256], int s1, int s3){
- state[0].u32[0] = mix_core(multbl, state[1].u8x4[0][0], state[1].u8x4[s1 ][1], state[1].u8x4[2][2], state[1].u8x4[s3 ][3]);
- state[0].u32[1] = mix_core(multbl, state[1].u8x4[1][0], state[1].u8x4[s3-1][1], state[1].u8x4[3][2], state[1].u8x4[s1-1][3]);
- state[0].u32[2] = mix_core(multbl, state[1].u8x4[2][0], state[1].u8x4[s3 ][1], state[1].u8x4[0][2], state[1].u8x4[s1 ][3]);
- state[0].u32[3] = mix_core(multbl, state[1].u8x4[3][0], state[1].u8x4[s1-1][1], state[1].u8x4[1][2], state[1].u8x4[s3-1][3]);
+ uint8_t (*src)[4] = state[1].u8x4;
+ state[0].u32[0] = mix_core(multbl, src[0][0], src[s1 ][1], src[2][2], src[s3 ][3]);
+ state[0].u32[1] = mix_core(multbl, src[1][0], src[s3-1][1], src[3][2], src[s1-1][3]);
+ state[0].u32[2] = mix_core(multbl, src[2][0], src[s3 ][1], src[0][2], src[s1 ][3]);
+ state[0].u32[3] = mix_core(multbl, src[3][0], src[s1-1][1], src[1][2], src[s3-1][3]);
}
static inline void crypt(AVAES *a, int s, const uint8_t *sbox, uint32_t multbl[][256]){