diff --git a/ChangeLog b/ChangeLog index fd47079ff51d86d700e58c840cb8444ea07aa765..02e69496affadb1648d86f7d523e6aeb15e5d539 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2015-03-10 Niels Möller <nisse@diamant.hack.org> + + * curve25519-mul.c (curve25519_mul): Changed return type to void. + * examples/hogweed-benchmark.c (bench_curve25519_mul): Drop check + of curve25519_mul return value. + * testsuite/curve25519-dh-test.c (test_a): Likewise. + 2015-02-26 Niels Möller <nisse@diamant.hack.org> * nettle.texinfo: Document curve25519 and eddsa. diff --git a/curve25519-mul.c b/curve25519-mul.c index 0e280244ad1bba819853f49c0bd35bc0c1a0ec16..3dbb3ddee58b1aa7bf6bee10afd78245a7cdea8b 100644 --- a/curve25519-mul.c +++ b/curve25519-mul.c @@ -41,7 +41,7 @@ #include "ecc-internal.h" /* Intended to be compatible with NaCl's crypto_scalarmult. */ -int +void curve25519_mul (uint8_t *q, const uint8_t *n, const uint8_t *p) { const struct ecc_curve *ecc = &nettle_curve25519; @@ -139,5 +139,4 @@ curve25519_mul (uint8_t *q, const uint8_t *n, const uint8_t *p) mpn_get_base256_le (q, CURVE25519_SIZE, x2, ecc->p.size); gmp_free_limbs (scratch, itch); - return 1; } diff --git a/curve25519.h b/curve25519.h index d9bcb0d5a4ac0527a13e0610fa9645e1652206bc..b47200b92dbc5337112eefd05fb9162f99af3874 100644 --- a/curve25519.h +++ b/curve25519.h @@ -47,8 +47,7 @@ extern "C" { void curve25519_mul_g (uint8_t *q, const uint8_t *n); -/* FIXME: Switch to void return type? */ -int +void curve25519_mul (uint8_t *q, const uint8_t *n, const uint8_t *p); #ifdef __cplusplus diff --git a/examples/hogweed-benchmark.c b/examples/hogweed-benchmark.c index 3d7b5855cd91df4588c01c05bb465051ded14c79..444d7aab3ce01595bc35cc10989c293f63662b47 100644 --- a/examples/hogweed-benchmark.c +++ b/examples/hogweed-benchmark.c @@ -669,8 +669,7 @@ bench_curve25519_mul (void *p) { struct curve25519_ctx *ctx = p; char q[CURVE25519_SIZE]; - if (!curve25519_mul (q, ctx->s, ctx->x)) - die ("Internal error, curve25519_mul failed.\n"); + curve25519_mul (q, ctx->s, ctx->x); } static void diff --git a/testsuite/curve25519-dh-test.c b/testsuite/curve25519-dh-test.c index cd075d9952f76fedb7d424f3aabff3ecd2cf980c..11b42632685b908904a057a22eaa454498703e73 100644 --- a/testsuite/curve25519-dh-test.c +++ b/testsuite/curve25519-dh-test.c @@ -55,15 +55,7 @@ static void test_a (const uint8_t *s, const uint8_t *b, const uint8_t *r) { uint8_t p[CURVE25519_SIZE]; - if (!curve25519_mul (p, s, b)) - { - printf ("curve25519_mul returned 0:\ns = "); - print_hex (CURVE25519_SIZE, s); - printf ("\nb = "); - print_hex (CURVE25519_SIZE, b); - printf ("\n"); - abort (); - } + curve25519_mul (p, s, b); if (!MEMEQ (CURVE25519_SIZE, p, r)) {