[git] GCRYPT - branch, LIBGCRYPT-1-5-BRANCH, updated. libgcrypt-1.5.1-7-gcc2f851

by Werner Koch cvs at cvs.gnupg.org
Thu Apr 18 10:23:38 CEST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU crypto library".

The branch, LIBGCRYPT-1-5-BRANCH has been updated
       via  cc2f85116226bf9e2b77c4949eb1e7ea2357f67d (commit)
      from  c7362450c679736ceb82e95fac2e251972f3ea1e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit cc2f85116226bf9e2b77c4949eb1e7ea2357f67d
Author: Werner Koch <wk at wheatstone.g10code.de>
Date:   Tue Apr 16 18:59:22 2013 +0200

    Fix multiply by zero in gcry_mpi_ec_mul.
    
    * mpi/ec.c (_gcry_mpi_ec_mul_point): Handle case of SCALAR == 0.
    --
    This is backport from master leaving out the test case.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/mpi/ec.c b/mpi/ec.c
index ce86e09..fa00818 100644
--- a/mpi/ec.c
+++ b/mpi/ec.c
@@ -670,10 +670,23 @@ _gcry_mpi_ec_mul_point (mpi_point_t *result,
 
   mpi_mul (h, k, ctx->three); /* h = 3k */
   loops = mpi_get_nbits (h);
-
-  mpi_set (result->x, point->x);
-  mpi_set (result->y, yy); mpi_free (yy); yy = NULL;
-  mpi_set (result->z, point->z);
+  if (loops < 2)
+    {
+      /* If SCALAR is zero, the above mpi_mul sets H to zero and thus
+         LOOPs will be zero.  To avoid an underflow of I in the main
+         loop we set LOOP to 2 and the result to (0,0,0).  */
+      loops = 2;
+      mpi_clear (result->x);
+      mpi_clear (result->y);
+      mpi_clear (result->z);
+    }
+  else
+    {
+      mpi_set (result->x, point->x);
+      mpi_set (result->y, yy);
+      mpi_set (result->z, point->z);
+    }
+  mpi_free (yy); yy = NULL;
 
   p1.x = x1; x1 = NULL;
   p1.y = y1; y1 = NULL;

-----------------------------------------------------------------------

Summary of changes:
 mpi/ec.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org




More information about the Gnupg-commits mailing list