+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.
#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;
mpn_get_base256_le (q, CURVE25519_SIZE, x2, ecc->p.size);
gmp_free_limbs (scratch, itch);
- return 1;
}
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
{
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
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))
{