gnutls-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU gnutls branch, master, updated. gnutls_2_99_1-55-g0ccb743


From: Nikos Mavrogiannopoulos
Subject: [SCM] GNU gnutls branch, master, updated. gnutls_2_99_1-55-g0ccb743
Date: Sat, 21 May 2011 08:44:52 +0000

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 "GNU gnutls".

http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=0ccb743edcd9237b4b38d777d10a85a353114177

The branch, master has been updated
       via  0ccb743edcd9237b4b38d777d10a85a353114177 (commit)
      from  b1f29acf584794671eb4bae739d721b9f3bad4e8 (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 0ccb743edcd9237b4b38d777d10a85a353114177
Author: Nikos Mavrogiannopoulos <address@hidden>
Date:   Sat May 21 10:44:44 2011 +0200

    Dropped ltc_ from function and type names.

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

Summary of changes:
 lib/nettle/ecc.h                        |   24 ++++++++++------------
 lib/nettle/ecc_make_key.c               |    8 +++---
 lib/nettle/ecc_map.c                    |    6 ++--
 lib/nettle/ecc_mulmod.c                 |   32 +++++++++++++++---------------
 lib/nettle/ecc_points.c                 |    8 +++---
 lib/nettle/ecc_projective_add_point.c   |    8 +++---
 lib/nettle/ecc_projective_dbl_point.c   |    2 +-
 lib/nettle/ecc_projective_dbl_point_3.c |    6 ++--
 lib/nettle/ecc_shared_secret.c          |    6 ++--
 lib/nettle/ecc_test.c                   |   14 ++++++------
 lib/nettle/ecc_verify_hash.c            |   16 +++++++-------
 lib/nettle/pk.c                         |    2 +-
 12 files changed, 65 insertions(+), 67 deletions(-)

diff --git a/lib/nettle/ecc.h b/lib/nettle/ecc.h
index 56fafc8..e9033ad 100644
--- a/lib/nettle/ecc.h
+++ b/lib/nettle/ecc.h
@@ -9,7 +9,8 @@
 /* assume y^2 = x^3 - 3x + b
  * instead of the generic y^2 = x^3 + ax + b
  *
- * (XXX: the generic case has not been tested)
+ * (XXX: the generic case has been tested only
+ *  with the SECG curves.)
  */
 #define ECC_SECP_CURVES_ONLY
 
@@ -48,7 +49,7 @@ typedef struct {
  
    /** The y co-ordinate of the base point on the curve (hex) */
    const char *Gy;
-} ltc_ecc_set_type;
+} ecc_set_type;
 
 /** A point on a ECC curve, stored in Jacbobian format such that (x,y,z) => 
(x/z^2, y/z^3, 1) when interpretted as affine */
 typedef struct {
@@ -80,14 +81,11 @@ typedef struct {
     mpz_t k;
 } ecc_key;
 
-/** the ECC params provided */
-extern const ltc_ecc_set_type ltc_ecc_sets[];
-
 int  ecc_test(void);
 void ecc_sizes(int *low, int *high);
 int  ecc_get_size(ecc_key *key);
 
-int ecc_make_key(void *random_ctx, nettle_random_func random, ecc_key *key, 
const ltc_ecc_set_type *dp);
+int ecc_make_key(void *random_ctx, nettle_random_func random, ecc_key *key, 
const ecc_set_type *dp);
 int ecc_make_key_ex(void *random_ctx, nettle_random_func random, ecc_key *key, 
mpz_t prime, mpz_t order, mpz_t A, mpz_t Gx, mpz_t Gy);
 void ecc_free(ecc_key *key);
 
@@ -103,22 +101,22 @@ int  ecc_verify_hash(struct dsa_signature * signature,
                      int *stat, ecc_key *key);
 
 /* low level functions */
-ecc_point *ltc_ecc_new_point(void);
-void       ltc_ecc_del_point(ecc_point *p);
-int        ltc_ecc_is_valid_idx(int n);
+ecc_point *ecc_new_point(void);
+void       ecc_del_point(ecc_point *p);
+int        ecc_is_valid_idx(int n);
 
 /* point ops (mp == montgomery digit) */
 /* R = 2P */
-int ltc_ecc_projective_dbl_point(ecc_point *P, ecc_point *R, mpz_t a,  mpz_t 
modulus);
+int ecc_projective_dbl_point(ecc_point *P, ecc_point *R, mpz_t a,  mpz_t 
modulus);
 
 /* R = P + Q */
-int ltc_ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, 
mpz_t A, mpz_t modulus);
+int ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R, mpz_t 
A, mpz_t modulus);
 
 /* R = kG */
-int ltc_ecc_mulmod(mpz_t k, ecc_point *G, ecc_point *R, mpz_t a, mpz_t 
modulus, int map);
+int ecc_mulmod(mpz_t k, ecc_point *G, ecc_point *R, mpz_t a, mpz_t modulus, 
int map);
 
 /* map P to affine from projective */
-int ltc_ecc_map(ecc_point *P, mpz_t modulus);
+int ecc_map(ecc_point *P, mpz_t modulus);
 
 /* helper functions */
 int mp_init_multi(mpz_t *a, ...);
diff --git a/lib/nettle/ecc_make_key.c b/lib/nettle/ecc_make_key.c
index aab6fed..08af1bc 100644
--- a/lib/nettle/ecc_make_key.c
+++ b/lib/nettle/ecc_make_key.c
@@ -66,7 +66,7 @@ ecc_make_key_ex (void *random_ctx, nettle_random_func random, 
ecc_key * key,
     {
       goto ERR_BUF;
     }
-  base = ltc_ecc_new_point ();
+  base = ecc_new_point ();
   if (base == NULL)
     {
       err = -1;
@@ -96,7 +96,7 @@ ecc_make_key_ex (void *random_ctx, nettle_random_func random, 
ecc_key * key,
     }
   /* make the public key */
   if ((err =
-       ltc_ecc_mulmod (key->k, base, &key->pubkey, key->A, key->prime,
+       ecc_mulmod (key->k, base, &key->pubkey, key->A, key->prime,
                        1)) != 0)
     {
       goto errkey;
@@ -111,7 +111,7 @@ errkey:
                   &key->order, &key->prime, &key->Gx, &key->Gy, &key->A,
                   NULL);
 cleanup:
-  ltc_ecc_del_point (base);
+  ecc_del_point (base);
 ERR_BUF:
   free (buf);
   return err;
@@ -119,7 +119,7 @@ ERR_BUF:
 
 int
 ecc_make_key (void *random_ctx, nettle_random_func random, ecc_key * key,
-              const ltc_ecc_set_type * dp)
+              const ecc_set_type * dp)
 {
   mpz_t prime, order, Gx, Gy, A;
   int err;
diff --git a/lib/nettle/ecc_map.c b/lib/nettle/ecc_map.c
index bbe99ec..2ad60bb 100644
--- a/lib/nettle/ecc_map.c
+++ b/lib/nettle/ecc_map.c
@@ -17,7 +17,7 @@
 #include "ecc.h"
 
 /**
-  @file ltc_ecc_map.c
+  @file ecc_map.c
   ECC Crypto, Tom St Denis
 */
 
@@ -29,7 +29,7 @@
   @return 0 on success
 */
 int
-ltc_ecc_map (ecc_point * P, mpz_t modulus)
+ecc_map (ecc_point * P, mpz_t modulus)
 {
   mpz_t t1, t2;
   int err;
@@ -65,6 +65,6 @@ ltc_ecc_map (ecc_point * P, mpz_t modulus)
   return err;
 }
 
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_map.c,v $ */
+/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ecc_map.c,v $ */
 /* $Revision: 1.7 $ */
 /* $Date: 2007/05/12 14:32:35 $ */
diff --git a/lib/nettle/ecc_mulmod.c b/lib/nettle/ecc_mulmod.c
index 1236dc3..c8e91a4 100644
--- a/lib/nettle/ecc_mulmod.c
+++ b/lib/nettle/ecc_mulmod.c
@@ -17,7 +17,7 @@
 #include "ecc.h"
 
 /**
-  @file ltc_ecc_mulmod_timing.c
+  @file ecc_mulmod_timing.c
   ECC Crypto, Tom St Denis
 */
 
@@ -32,7 +32,7 @@
    @return 0 on success
 */
 int
-ltc_ecc_mulmod (mpz_t k, ecc_point * G, ecc_point * R, mpz_t a, mpz_t modulus,
+ecc_mulmod (mpz_t k, ecc_point * G, ecc_point * R, mpz_t a, mpz_t modulus,
                 int map)
 {
   ecc_point *tG, *M[3];
@@ -48,19 +48,19 @@ ltc_ecc_mulmod (mpz_t k, ecc_point * G, ecc_point * R, 
mpz_t a, mpz_t modulus,
   /* alloc ram for window temps */
   for (i = 0; i < 3; i++)
     {
-      M[i] = ltc_ecc_new_point ();
+      M[i] = ecc_new_point ();
       if (M[i] == NULL)
         {
           for (j = 0; j < i; j++)
             {
-              ltc_ecc_del_point (M[j]);
+              ecc_del_point (M[j]);
             }
           return -1;
         }
     }
 
   /* make a copy of G incase R==G */
-  tG = ltc_ecc_new_point ();
+  tG = ecc_new_point ();
   if (tG == NULL)
     {
       err = -1;
@@ -78,7 +78,7 @@ ltc_ecc_mulmod (mpz_t k, ecc_point * G, ecc_point * R, mpz_t 
a, mpz_t modulus,
   mpz_set (M[0]->y, tG->y);
   mpz_set (M[0]->z, tG->z);
   /* M[1] == 2G */
-  if ((err = ltc_ecc_projective_dbl_point (tG, M[1], a, modulus)) != 0)
+  if ((err = ecc_projective_dbl_point (tG, M[1], a, modulus)) != 0)
     {
       goto done;
     }
@@ -114,13 +114,13 @@ ltc_ecc_mulmod (mpz_t k, ecc_point * G, ecc_point * R, 
mpz_t a, mpz_t modulus,
         {
           /* dummy operations */
           if ((err =
-               ltc_ecc_projective_add_point (M[0], M[1], M[2], a,
+               ecc_projective_add_point (M[0], M[1], M[2], a,
                                              modulus)) != 0)
             {
               goto done;
             }
           if ((err =
-               ltc_ecc_projective_dbl_point (M[1], M[2], a, modulus)) != 0)
+               ecc_projective_dbl_point (M[1], M[2], a, modulus)) != 0)
             {
               goto done;
             }
@@ -132,13 +132,13 @@ ltc_ecc_mulmod (mpz_t k, ecc_point * G, ecc_point * R, 
mpz_t a, mpz_t modulus,
           mode = 1;
           /* dummy operations */
           if ((err =
-               ltc_ecc_projective_add_point (M[0], M[1], M[2], a,
+               ecc_projective_add_point (M[0], M[1], M[2], a,
                                              modulus)) != 0)
             {
               goto done;
             }
           if ((err =
-               ltc_ecc_projective_dbl_point (M[1], M[2], a, modulus)) != 0)
+               ecc_projective_dbl_point (M[1], M[2], a, modulus)) != 0)
             {
               goto done;
             }
@@ -146,12 +146,12 @@ ltc_ecc_mulmod (mpz_t k, ecc_point * G, ecc_point * R, 
mpz_t a, mpz_t modulus,
         }
 
       if ((err =
-           ltc_ecc_projective_add_point (M[0], M[1], M[i ^ 1], a,
+           ecc_projective_add_point (M[0], M[1], M[i ^ 1], a,
                                          modulus)) != 0)
         {
           goto done;
         }
-      if ((err = ltc_ecc_projective_dbl_point (M[i], M[i], a, modulus)) != 0)
+      if ((err = ecc_projective_dbl_point (M[i], M[i], a, modulus)) != 0)
         {
           goto done;
         }
@@ -165,21 +165,21 @@ ltc_ecc_mulmod (mpz_t k, ecc_point * G, ecc_point * R, 
mpz_t a, mpz_t modulus,
   /* map R back from projective space */
   if (map)
     {
-      err = ltc_ecc_map (R, modulus);
+      err = ecc_map (R, modulus);
     }
   else
     {
       err = 0;
     }
 done:
-  ltc_ecc_del_point (tG);
+  ecc_del_point (tG);
   for (i = 0; i < 3; i++)
     {
-      ltc_ecc_del_point (M[i]);
+      ecc_del_point (M[i]);
     }
   return err;
 }
 
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod_timing.c,v $ */
+/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ecc_mulmod_timing.c,v $ */
 /* $Revision: 1.13 $ */
 /* $Date: 2007/05/12 14:32:35 $ */
diff --git a/lib/nettle/ecc_points.c b/lib/nettle/ecc_points.c
index fa9b5b5..7a29cb1 100644
--- a/lib/nettle/ecc_points.c
+++ b/lib/nettle/ecc_points.c
@@ -17,7 +17,7 @@
 #include "ecc.h"
 
 /**
-  @file ltc_ecc_points.c
+  @file ecc_points.c
   ECC Crypto, Tom St Denis
 */
 
@@ -26,7 +26,7 @@
    @return A newly allocated point or NULL on error 
 */
 ecc_point *
-ltc_ecc_new_point (void)
+ecc_new_point (void)
 {
   ecc_point *p;
   p = calloc (1, sizeof (*p));
@@ -46,7 +46,7 @@ ltc_ecc_new_point (void)
   @param p   The point to free
 */
 void
-ltc_ecc_del_point (ecc_point * p)
+ecc_del_point (ecc_point * p)
 {
   /* prevents free'ing null arguments */
   if (p != NULL)
@@ -56,6 +56,6 @@ ltc_ecc_del_point (ecc_point * p)
     }
 }
 
-/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_points.c,v $ */
+/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ecc_points.c,v $ */
 /* $Revision: 1.7 $ */
 /* $Date: 2007/05/12 14:32:35 $ */
diff --git a/lib/nettle/ecc_projective_add_point.c 
b/lib/nettle/ecc_projective_add_point.c
index dd98eb4..daf77ba 100644
--- a/lib/nettle/ecc_projective_add_point.c
+++ b/lib/nettle/ecc_projective_add_point.c
@@ -17,7 +17,7 @@
 #include "ecc.h"
 
 /**
-  @file ltc_ecc_projective_add_point.c
+  @file ecc_projective_add_point.c
   ECC Crypto, Tom St Denis
 */
 
@@ -31,7 +31,7 @@
    @return 0 on success
 */
 int
-ltc_ecc_projective_add_point (ecc_point * P, ecc_point * Q, ecc_point * R,
+ecc_projective_add_point (ecc_point * P, ecc_point * Q, ecc_point * R,
                               mpz_t A, mpz_t modulus)
 {
   mpz_t t1, t2, x, y, z;
@@ -55,7 +55,7 @@ ltc_ecc_projective_add_point (ecc_point * P, ecc_point * Q, 
ecc_point * R,
       (mpz_cmp (P->y, Q->y) == 0 || mpz_cmp (P->y, t1) == 0))
     {
       mp_clear_multi (&t1, &t2, &x, &y, &z, NULL);
-      return ltc_ecc_projective_dbl_point (P, R, A, modulus);
+      return ecc_projective_dbl_point (P, R, A, modulus);
     }
 
   mpz_set (x, P->x);
@@ -202,6 +202,6 @@ ltc_ecc_projective_add_point (ecc_point * P, ecc_point * Q, 
ecc_point * R,
   return err;
 }
 
-/* $Source: 
/cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c,v $ */
+/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ecc_projective_add_point.c,v $ 
*/
 /* $Revision: 1.16 $ */
 /* $Date: 2007/05/12 14:32:35 $ */
diff --git a/lib/nettle/ecc_projective_dbl_point.c 
b/lib/nettle/ecc_projective_dbl_point.c
index 6d446c2..e6a3f2e 100644
--- a/lib/nettle/ecc_projective_dbl_point.c
+++ b/lib/nettle/ecc_projective_dbl_point.c
@@ -37,7 +37,7 @@
    @return 0 on success
 */
 int
-ltc_ecc_projective_dbl_point (ecc_point * P, ecc_point * R, mpz_t a,
+ecc_projective_dbl_point (ecc_point * P, ecc_point * R, mpz_t a,
                               mpz_t modulus)
 {
   mpz_t t1, m, s;
diff --git a/lib/nettle/ecc_projective_dbl_point_3.c 
b/lib/nettle/ecc_projective_dbl_point_3.c
index 7c415fe..1b85f68 100644
--- a/lib/nettle/ecc_projective_dbl_point_3.c
+++ b/lib/nettle/ecc_projective_dbl_point_3.c
@@ -17,7 +17,7 @@
 #include "ecc.h"
 
 /**
-  @file ltc_ecc_projective_dbl_point.c
+  @file ecc_projective_dbl_point.c
   ECC Crypto, Tom St Denis
 */  
 
@@ -32,7 +32,7 @@
    @return 0 on success
 */
 int
-ltc_ecc_projective_dbl_point (ecc_point * P, ecc_point * R, mpz_t a /* a is -3 
*/,
+ecc_projective_dbl_point (ecc_point * P, ecc_point * R, mpz_t a /* a is -3 */,
                               mpz_t modulus)
 {
    mpz_t t1, t2;
@@ -142,7 +142,7 @@ ltc_ecc_projective_dbl_point (ecc_point * P, ecc_point * R, 
mpz_t a /* a is -3 *
    return err;
 }
 #endif
-/* $Source: 
/cvs/libtom/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c,v $ */
+/* $Source: /cvs/libtom/libtomcrypt/src/pk/ecc/ecc_projective_dbl_point.c,v $ 
*/
 /* $Revision: 1.11 $ */
 /* $Date: 2007/05/12 14:32:35 $ */
 
diff --git a/lib/nettle/ecc_shared_secret.c b/lib/nettle/ecc_shared_secret.c
index 61012fd..6207419 100644
--- a/lib/nettle/ecc_shared_secret.c
+++ b/lib/nettle/ecc_shared_secret.c
@@ -50,14 +50,14 @@ ecc_shared_secret (ecc_key * private_key, ecc_key * 
public_key,
     }
 
   /* make new point */
-  result = ltc_ecc_new_point ();
+  result = ecc_new_point ();
   if (result == NULL)
     {
       return -1;
     }
 
   if ((err =
-       ltc_ecc_mulmod (private_key->k, &public_key->pubkey, result,
+       ecc_mulmod (private_key->k, &public_key->pubkey, result,
                        private_key->A, private_key->prime, 1)) != 0)
     {
       goto done;
@@ -82,7 +82,7 @@ ecc_shared_secret (ecc_key * private_key, ecc_key * 
public_key,
   err = 0;
   *outlen = x;
 done:
-  ltc_ecc_del_point (result);
+  ecc_del_point (result);
   return err;
 }
 
diff --git a/lib/nettle/ecc_test.c b/lib/nettle/ecc_test.c
index 0bdcd35..dd84b82 100644
--- a/lib/nettle/ecc_test.c
+++ b/lib/nettle/ecc_test.c
@@ -40,13 +40,13 @@ ecc_test (void)
       return err;
     }
 
-  G = ltc_ecc_new_point ();
-  GG = ltc_ecc_new_point ();
+  G = ecc_new_point ();
+  GG = ecc_new_point ();
   if (G == NULL || GG == NULL)
     {
       mp_clear_multi (&modulus, &order, NULL);
-      ltc_ecc_del_point (G);
-      ltc_ecc_del_point (GG);
+      ecc_del_point (G);
+      ecc_del_point (GG);
       return -1;
     }
 
@@ -109,7 +109,7 @@ ecc_test (void)
 
       /* then we should have G == (order + 1)G */
       mpz_add_ui (order, order, 1);
-      if ((err = ltc_ecc_mulmod (order, G, GG, A, modulus, 1)) != 0)
+      if ((err = ecc_mulmod (order, G, GG, A, modulus, 1)) != 0)
         {
           goto done;
         }
@@ -131,8 +131,8 @@ ecc_test (void)
     }
   err = 0;
 done:
-  ltc_ecc_del_point (GG);
-  ltc_ecc_del_point (G);
+  ecc_del_point (GG);
+  ecc_del_point (G);
   mp_clear_multi (&order, &modulus, &A, NULL);
   return err;
 }
diff --git a/lib/nettle/ecc_verify_hash.c b/lib/nettle/ecc_verify_hash.c
index b9f6ec0..df66927 100644
--- a/lib/nettle/ecc_verify_hash.c
+++ b/lib/nettle/ecc_verify_hash.c
@@ -64,8 +64,8 @@ ecc_verify_hash (struct dsa_signature *signature,
     }
 
   /* allocate points */
-  mG = ltc_ecc_new_point ();
-  mQ = ltc_ecc_new_point ();
+  mG = ecc_new_point ();
+  mQ = ecc_new_point ();
   if (mQ == NULL || mG == NULL)
     {
       err = -1;
@@ -109,24 +109,24 @@ ecc_verify_hash (struct dsa_signature *signature,
   mpz_set (mQ->z, key->pubkey.z);
 
   /* compute u1*mG + u2*mQ = mG */
-  if ((err = ltc_ecc_mulmod (u1, mG, mG, key->A, key->prime, 0)) != 0)
+  if ((err = ecc_mulmod (u1, mG, mG, key->A, key->prime, 0)) != 0)
     {
       goto error;
     }
-  if ((err = ltc_ecc_mulmod (u2, mQ, mQ, key->A, key->prime, 0)) != 0)
+  if ((err = ecc_mulmod (u2, mQ, mQ, key->A, key->prime, 0)) != 0)
     {
       goto error;
     }
 
   /* add them */
   if ((err =
-       ltc_ecc_projective_add_point (mQ, mG, mG, key->A, key->prime)) != 0)
+       ecc_projective_add_point (mQ, mG, mG, key->A, key->prime)) != 0)
     {
       goto error;
     }
 
   /* reduce */
-  if ((err = ltc_ecc_map (mG, key->prime)) != 0)
+  if ((err = ecc_map (mG, key->prime)) != 0)
     {
       goto error;
     }
@@ -143,8 +143,8 @@ ecc_verify_hash (struct dsa_signature *signature,
   /* clear up and return */
   err = 0;
 error:
-  ltc_ecc_del_point (mG);
-  ltc_ecc_del_point (mQ);
+  ecc_del_point (mG);
+  ecc_del_point (mQ);
   mp_clear_multi (&v, &w, &u1, &u2, &e, NULL);
   return err;
 }
diff --git a/lib/nettle/pk.c b/lib/nettle/pk.c
index 62342d9..22bf8b0 100644
--- a/lib/nettle/pk.c
+++ b/lib/nettle/pk.c
@@ -684,7 +684,7 @@ rsa_fail:
     case GNUTLS_PK_ECDH:
       {
         ecc_key key;
-        ltc_ecc_set_type tls_ecc_set;
+        ecc_set_type tls_ecc_set;
         const gnutls_ecc_curve_entry_st *st;
 
         st = _gnutls_ecc_curve_get_params(level);


hooks/post-receive
-- 
GNU gnutls



reply via email to

[Prev in Thread] Current Thread [Next in Thread]