diff options
author | Niels Möller <nisse@lysator.liu.se> | 2015-03-10 22:54:56 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2015-03-10 22:54:56 +0100 |
commit | d5e787e3c6d25e1e646b502b039277c16228549c (patch) | |
tree | eb7c8bcd3e425d97fe33e7d9cdbd2c7220910af5 | |
parent | ac804944fd4b52990f784961074ec5ff1733962b (diff) | |
download | nettle-d5e787e3c6d25e1e646b502b039277c16228549c.tar.gz |
Changed return type for curve25519_mul to void.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | curve25519-mul.c | 3 | ||||
-rw-r--r-- | curve25519.h | 3 | ||||
-rw-r--r-- | examples/hogweed-benchmark.c | 3 | ||||
-rw-r--r-- | testsuite/curve25519-dh-test.c | 10 |
5 files changed, 11 insertions, 15 deletions
@@ -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 0e280244..3dbb3dde 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 d9bcb0d5..b47200b9 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 3d7b5855..444d7aab 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 cd075d99..11b42632 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)) { |