]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
MD_PAD: Don't depend on sizeof of the count field(s).
authorNiels Möller <nisse@lysator.liu.se>
Sat, 28 Sep 2013 07:21:38 +0000 (09:21 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Sat, 28 Sep 2013 07:21:38 +0000 (09:21 +0200)
ChangeLog
macros.h

index 46bb9b56aa10ce6e15bedc34c2712bce9e8907be..72b692e134f6dc214b6b94d341c67b4d2c42c355 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-28  Niels Möller  <nisse@lysator.liu.se>
+
+       * macros.h (MD_PAD): Use size argument, don't depend on
+       sizeof of the count field(s).
+
 2013-09-22  Niels Möller  <nisse@lysator.liu.se>
 
        * x86_64/gcm-hash8.asm: New file.
index c471c26d868c94c7ecf02302a5c44ff28f325ac6..fb814239919f7579f19478a983025964c4d5aa29 100644 (file)
--- a/macros.h
+++ b/macros.h
@@ -225,7 +225,7 @@ do {                                                \
     assert(__md_i < sizeof((ctx)->block));                                     \
     (ctx)->block[__md_i++] = 0x80;                                             \
                                                                        \
-    if (__md_i > (sizeof((ctx)->block) - 2*sizeof((ctx)->count_low)))  \
+    if (__md_i > (sizeof((ctx)->block) - (size)))                      \
       { /* No room for length in this block. Process it and            \
           pad with another one */                                      \
        memset((ctx)->block + __md_i, 0, sizeof((ctx)->block) - __md_i); \