[git] GCRYPT - branch, master, updated. libgcrypt-1.5.0-315-gb224171

by Werner Koch cvs at cvs.gnupg.org
Thu Oct 17 10:50:24 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, master has been updated
       via  b22417158c50ec3a0b2ff55b4ade063b42a87e8f (commit)
      from  f9371c026aad09ff48746d22c8333746c886e773 (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 b22417158c50ec3a0b2ff55b4ade063b42a87e8f
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 17 10:45:14 2013 +0200

    ecc: Support Weierstrass curves in gcry_mpi_ec_curve_point.
    
    * mpi/ec.c (_gcry_mpi_ec_curve_point): Support MPI_EC_WEIERSTRASS.

diff --git a/mpi/ec.c b/mpi/ec.c
index 889df8e..39ab5eb 100644
--- a/mpi/ec.c
+++ b/mpi/ec.c
@@ -1216,8 +1216,23 @@ _gcry_mpi_ec_curve_point (gcry_mpi_point_t point, mpi_ec_t ctx)
   switch (ctx->model)
     {
     case MPI_EC_WEIERSTRASS:
-      log_fatal ("%s: %s not yet supported\n",
-                 "_gcry_mpi_ec_curve_point", "Weierstrass");
+      {
+        gcry_mpi_t xx = mpi_new (0);
+
+        /* y^2 == x^3 + a·x^2 + b */
+        ec_pow2 (y, y, ctx);
+
+        ec_pow2 (xx, x, ctx);
+        ec_mulm (w, ctx->a, xx, ctx);
+        ec_addm (w, w, ctx->b, ctx);
+        ec_mulm (xx, xx, x, ctx);
+        ec_addm (w, w, xx, ctx);
+
+        if (!mpi_cmp (y, w))
+          res = 1;
+
+        gcry_mpi_release (xx);
+      }
       break;
     case MPI_EC_MONTGOMERY:
       log_fatal ("%s: %s not yet supported\n",

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

Summary of changes:
 mpi/ec.c |   19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)


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


_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits


More information about the Gcrypt-devel mailing list