diff libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c @ 1471:6dba84798cd5

Update to libtomcrypt 1.18.1, merged with Dropbear changes
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 21:44:05 +0800
parents f849a5ca2efc
children
line wrap: on
line diff
--- a/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c	Thu Feb 08 23:11:40 2018 +0800
+++ b/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c	Fri Feb 09 21:44:05 2018 +0800
@@ -5,8 +5,6 @@
  *
  * The library is free for all purposes without any express
  * guarantee it works.
- *
- * Tom St Denis, [email protected], http://libtom.org
  */
 
 /* Implements ECC over Z/pZ for curve y^2 = x^3 - 3x + b
@@ -19,7 +17,7 @@
 /**
   @file ltc_ecc_mulmod.c
   ECC Crypto, Tom St Denis
-*/  
+*/
 
 #ifdef LTC_MECC
 #ifndef LTC_ECC_TIMING_RESISTANT
@@ -28,7 +26,7 @@
 #define WINSIZE 4
 
 /**
-   Perform a point multiplication 
+   Perform a point multiplication
    @param k    The scalar to multiply by
    @param G    The base point
    @param R    [out] Destination for kG
@@ -41,7 +39,7 @@
    ecc_point *tG, *M[8];
    int        i, j, err;
    void       *mu, *mp;
-   unsigned long buf;
+   ltc_mp_digit buf;
    int        first, bitbuf, bitcpy, bitcnt, mode, digidx;
 
    LTC_ARGCHK(k       != NULL);
@@ -62,7 +60,7 @@
       mp_clear(mu);
       return err;
    }
-  
+
   /* alloc ram for window temps */
   for (i = 0; i < 8; i++) {
       M[i] = ltc_ecc_new_point();
@@ -85,14 +83,14 @@
       if ((err = mp_copy(G->x, tG->x)) != CRYPT_OK)                                  { goto done; }
       if ((err = mp_copy(G->y, tG->y)) != CRYPT_OK)                                  { goto done; }
       if ((err = mp_copy(G->z, tG->z)) != CRYPT_OK)                                  { goto done; }
-   } else {      
+   } else {
       if ((err = mp_mulmod(G->x, mu, modulus, tG->x)) != CRYPT_OK)                   { goto done; }
       if ((err = mp_mulmod(G->y, mu, modulus, tG->y)) != CRYPT_OK)                   { goto done; }
       if ((err = mp_mulmod(G->z, mu, modulus, tG->z)) != CRYPT_OK)                   { goto done; }
    }
    mp_clear(mu);
    mu = NULL;
-   
+
    /* calc the M tab, which holds kG for k==8..15 */
    /* M[0] == 8G */
    if ((err = ltc_mp.ecc_ptdbl(tG, M[0], modulus, mp)) != CRYPT_OK)                 { goto done; }
@@ -217,6 +215,6 @@
 
 #endif
 
-/* $Source$ */
-/* $Revision$ */
-/* $Date$ */
+/* ref:         $Format:%D$ */
+/* git commit:  $Format:%H$ */
+/* commit time: $Format:%ai$ */