tiddy up 25519

This commit is contained in:
toddouska
2015-02-19 16:07:13 -08:00
parent cc642fbaf6
commit 420668c1f9
8 changed files with 17 additions and 20 deletions

View File

@@ -1601,13 +1601,8 @@ void bench_ecc25519KeyGen(void)
{
ecc25519_key genKey;
double start, total, each, milliEach;
int i, ret;
int i;
ret = wc_InitRng(&rng);
if (ret < 0) {
printf("InitRNG failed\n");
return;
}
/* 256 bit */
start = current_time(1);
@@ -1636,12 +1631,6 @@ void bench_ecc25519KeyAgree(void)
wc_ecc25519_init(&genKey);
wc_ecc25519_init(&genKey2);
ret = wc_InitRng(&rng);
if (ret < 0) {
printf("InitRNG failed\n");
return;
}
ret = wc_ecc25519_make_key(&rng, 32, &genKey);
if (ret != 0) {
printf("ecc25519_make_key failed\n");

View File

@@ -17,10 +17,10 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* From Daniel J Bernstein's curve25519 ref10 work.
*/
/* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */
#ifdef HAVE_CONFIG_H
#include <config.h>

View File

@@ -17,10 +17,10 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* From Daniel J Bernstein's curve25519 ref10 work.
*/
/* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */
#ifdef HAVE_ECC25519

View File

@@ -5068,6 +5068,10 @@ int ecc25519_test(void)
wc_ecc25519_free(&userB);
wc_ecc25519_free(&userA);
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
wc_FreeRng(&rng);
#endif
return 0;
}
#endif /* HAVE_ECC25519 */

View File

@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */
#ifdef HAVE_ECC25519
#ifndef WOLF_CRYPT_ECC25519_FE_H
#define WOLF_CRYPT_ECC25519_FE_H

View File

@@ -17,10 +17,10 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* From Daniel J Bernstein's curve25519 ref10 work.
*/
/* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */
fe_sub(tmp0,x3,z3);
fe_sub(tmp1,x2,z2);
fe_add(x2,x2,z2);

View File

@@ -17,10 +17,10 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* From Daniel J Bernstein's curve25519 ref10 work.
*/
/* Based On Daniel J Bernstein's curve25519 Public Domain ref10 work. */
fe_sq(t0,z); for (i = 1;i < 1;++i) fe_sq(t0,t0);
fe_sq(t1,t0); for (i = 1;i < 2;++i) fe_sq(t1,t1);
fe_mul(t1,z,t1);

View File

@@ -16,6 +16,8 @@ nobase_include_HEADERS+= \
wolfssl/wolfcrypt/ecc.h \
wolfssl/wolfcrypt/ecc25519.h \
wolfssl/wolfcrypt/ecc25519_fe.h \
wolfssl/wolfcrypt/ecc25519_pow225521.h \
wolfssl/wolfcrypt/ecc25519_montgomery.h \
wolfssl/wolfcrypt/error-crypt.h \
wolfssl/wolfcrypt/fips_test.h \
wolfssl/wolfcrypt/hc128.h \