summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2011-02-07 22:17:22 +0100
committerNiels Möller <nisse@lysator.liu.se>2011-02-07 22:17:22 +0100
commite5544e56eca254135f5699b1ce5cab63c9576782 (patch)
tree147c5dfd12fd7e51a65fce388327c7a252822f58
parent0984849e5b58618934a58c89ea5a0f381c5855b0 (diff)
downloadnettle-e5544e56eca254135f5699b1ce5cab63c9576782.tar.gz
* gcm.c (gcm_gf_shift_chunk) : Bug fix for little-endian 8-bit
tables. Rev: nettle/ChangeLog:1.137 Rev: nettle/gcm.c:1.8
-rw-r--r--ChangeLog3
-rw-r--r--gcm.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e89a119..a8ecc958 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2011-02-07 Niels Möller <nisse@lysator.liu.se>
+ * gcm.c (gcm_gf_shift_chunk) : Bug fix for little-endian 8-bit
+ tables.
+
* gcm.c (gcm_gf_mul_chunk): Special case first and last iteration.
(gcm_gf_add): New function, a special case of memxor. Use it for
all memxor calls with word-aligned 16 byte blocks. Improves
diff --git a/gcm.c b/gcm.c
index cea7da32..70598d44 100644
--- a/gcm.c
+++ b/gcm.c
@@ -283,8 +283,7 @@ gcm_gf_shift_chunk(uint8_t *x)
#endif
#else /* ! WORDS_BIGENDIAN */
# if SIZEOF_LONG == 4
-#define RSHIFT_WORD(x) \
- reduce = shift_table[(w[3] >> 56) & 0xff];
+ reduce = shift_table[(w[3] >> 24) & 0xff];
w[3] = (w[3] << 8) | (w[2] >> 24);
w[2] = (w[2] << 8) | (w[1] >> 24);
w[1] = (w[1] << 8) | (w[0] >> 24);