Commit d5e787e3 authored by Niels Möller's avatar Niels Möller

Changed return type for curve25519_mul to void.

parent ac804944
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.
......
......@@ -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;
}
......@@ -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
......
......@@ -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
......
......@@ -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))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment