[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-128-gd53ea84

by Werner Koch cvs at cvs.gnupg.org
Mon Nov 24 12:32:20 CET 2014


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  d53ea84bed37b973f7ce59262c50b33700cd8311 (commit)
       via  1b4210c204a5ef5e631187509e011b8468a134ef (commit)
      from  e6130034506013d6153465a2bedb6fb08a43f74d (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 d53ea84bed37b973f7ce59262c50b33700cd8311
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Nov 24 12:28:33 2014 +0100

    Remove duplicated prototypes.
    
    * src/gcrypt-int.h (_gcry_mpi_ec_new, _gcry_mpi_ec_set_mpi)
    (gcry_mpi_ec_set_point): Remove.
    --
    
    Thos used gpg_error_t instead of gpg_err_code_t and the picky AIX
    compiler takes this as a severe error.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/gcrypt-int.h b/src/gcrypt-int.h
index 918937b..29d4fd3 100644
--- a/src/gcrypt-int.h
+++ b/src/gcrypt-int.h
@@ -416,15 +416,10 @@ gcry_mpi_point_t _gcry_mpi_point_set (gcry_mpi_point_t point,
 gcry_mpi_point_t _gcry_mpi_point_snatch_set (gcry_mpi_point_t point,
                                             gcry_mpi_t x, gcry_mpi_t y,
                                             gcry_mpi_t z);
-gpg_error_t _gcry_mpi_ec_new (gcry_ctx_t *r_ctx,
-                             gcry_sexp_t keyparam, const char *curvename);
+
 gcry_mpi_t _gcry_mpi_ec_get_mpi (const char *name, gcry_ctx_t ctx, int copy);
 gcry_mpi_point_t _gcry_mpi_ec_get_point (const char *name,
                                         gcry_ctx_t ctx, int copy);
-gpg_error_t _gcry_mpi_ec_set_mpi (const char *name, gcry_mpi_t newvalue,
-                                 gcry_ctx_t ctx);
-gpg_error_t _gcry_mpi_ec_set_point (const char *name, gcry_mpi_point_t newvalue,
-                                   gcry_ctx_t ctx);
 int _gcry_mpi_ec_get_affine (gcry_mpi_t x, gcry_mpi_t y, gcry_mpi_point_t point,
                              mpi_ec_t ctx);
 void _gcry_mpi_ec_dup (gcry_mpi_point_t w, gcry_mpi_point_t u, gcry_ctx_t ctx);

commit 1b4210c204a5ef5e631187509e011b8468a134ef
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Oct 14 21:29:33 2014 +0200

    tests: Add a prime mode to benchmark.
    
    * tests/benchmark.c (progress_cb): Add a single char mode.
    (prime_bench): New.
    (main): Add a "prime" mode.  Factor with_progress out to file scope.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tests/benchmark.c b/tests/benchmark.c
index 2621551..5bf92da 100644
--- a/tests/benchmark.c
+++ b/tests/benchmark.c
@@ -62,6 +62,12 @@ static int in_fips_mode;
 /* Whether we are running as part of the regression test suite.  */
 static int in_regression_test;
 
+/* Whether --progress is in use.  */
+static int with_progress;
+
+/* Runtime flag to switch to a different progress output.  */
+static int single_char_progress;
+
 
 static const char sample_private_dsa_key_1024[] =
 "(private-key\n"
@@ -429,9 +435,17 @@ progress_cb (void *cb_data, const char *what, int printchar,
 {
   (void)cb_data;
 
-  fprintf (stderr, PGM ": progress (%s %c %d %d)\n",
-           what, printchar, current, total);
-  fflush (stderr);
+  if (single_char_progress)
+    {
+      fputc (printchar, stdout);
+      fflush (stderr);
+    }
+  else
+    {
+      fprintf (stderr, PGM ": progress (%s %c %d %d)\n",
+               what, printchar, current, total);
+      fflush (stderr);
+    }
 }
 
 
@@ -1544,6 +1558,51 @@ mpi_bench (void)
 }
 
 
+static void
+prime_bench (void)
+{
+  gpg_error_t err;
+  int i;
+  gcry_mpi_t prime;
+  int old_prog = single_char_progress;
+
+  single_char_progress = 1;
+  if (!with_progress)
+    printf ("%-10s", "prime");
+  fflush (stdout);
+  start_timer ();
+  for (i=0; i < 10; i++)
+    {
+      if (with_progress)
+        fputs ("primegen ", stdout);
+      err = gcry_prime_generate (&prime,
+                                 1024, 0,
+                                 NULL,
+                                 NULL, NULL,
+                                 GCRY_WEAK_RANDOM,
+                                 GCRY_PRIME_FLAG_SECRET);
+      if (with_progress)
+        {
+          fputc ('\n', stdout);
+          fflush (stdout);
+        }
+      if (err)
+        {
+          fprintf (stderr, PGM ": error creating prime: %s\n",
+                   gpg_strerror (err));
+          exit (1);
+        }
+      gcry_mpi_release (prime);
+    }
+  stop_timer ();
+  if (with_progress)
+    printf ("%-10s", "prime");
+  printf (" %s\n", elapsed_time ()); fflush (stdout);
+
+  single_char_progress = old_prog;
+}
+
+
 int
 main( int argc, char **argv )
 {
@@ -1551,7 +1610,6 @@ main( int argc, char **argv )
   int no_blinding = 0;
   int use_random_daemon = 0;
   int use_secmem = 0;
-  int with_progress = 0;
   int debug = 0;
   int pk_count = 100;
 
@@ -1582,7 +1640,7 @@ main( int argc, char **argv )
       else if (!strcmp (*argv, "--help"))
         {
           fputs ("usage: benchmark "
-                 "[md|mac|cipher|random|mpi|rsa|dsa|ecc [algonames]]\n",
+                 "[md|mac|cipher|random|mpi|rsa|dsa|ecc|prime [algonames]]\n",
                  stdout);
           exit (0);
         }
@@ -1833,6 +1891,11 @@ main( int argc, char **argv )
         gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
         ecc_bench (pk_count, 1);
     }
+  else if ( !strcmp (*argv, "prime"))
+    {
+        gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
+        prime_bench ();
+    }
   else
     {
       fprintf (stderr, PGM ": bad arguments\n");

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

Summary of changes:
 src/gcrypt-int.h  |    7 +----
 tests/benchmark.c |   73 +++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 69 insertions(+), 11 deletions(-)


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




More information about the Gnupg-commits mailing list