Browse code

aes: fix for big endian systems

This was missed in 5d20f19 since CONFIG_SMALL was always broken
for big endian.

Signed-off-by: Mans Rullgard <mans@mansr.com>

Mans Rullgard authored on 2011/07/03 19:20:39
Showing 1 changed files
... ...
@@ -54,7 +54,11 @@ static uint32_t enc_multbl[4][256];
54 54
 static uint32_t dec_multbl[4][256];
55 55
 #endif
56 56
 
57
-#define ROT(x, s) ((x << s) | (x >> (32-s)))
57
+#if HAVE_BIGENDIAN
58
+#   define ROT(x, s) ((x >> s) | (x << (32-s)))
59
+#else
60
+#   define ROT(x, s) ((x << s) | (x >> (32-s)))
61
+#endif
58 62
 
59 63
 static inline void addkey(av_aes_block *dst, const av_aes_block *src,
60 64
                           const av_aes_block *round_key)