Commit 6c8d40f7 authored by Niels Möller's avatar Niels Möller

Renamed curve25519_base -> curve25519_mul_g.

parent d55f928a
2014-08-18 Niels Möller <nisse@lysator.liu.se> 2014-08-18 Niels Möller <nisse@lysator.liu.se>
* curve25519-mul-g.c (curve25519_mul_g): Renamed file and
function, updated callers.
* curve25519-base.c (curve25519_base): ... old names.
* Makefile.in (hogweed_SOURCES): Updated for rename.
* eccdata.c (output_curve): Compute constants needed for * eccdata.c (output_curve): Compute constants needed for
Shanks-Tonelli. Shanks-Tonelli.
* ecc-25519.c (ecc_modp_powm_2kp1, ecc_25519_sqrt): New functions. * ecc-25519.c (ecc_modp_powm_2kp1, ecc_25519_sqrt): New functions.
......
...@@ -174,7 +174,7 @@ hogweed_SOURCES = sexp.c sexp-format.c \ ...@@ -174,7 +174,7 @@ hogweed_SOURCES = sexp.c sexp-format.c \
ecc-point.c ecc-scalar.c ecc-point-mul.c ecc-point-mul-g.c \ ecc-point.c ecc-scalar.c ecc-point-mul.c ecc-point-mul-g.c \
ecc-ecdsa-sign.c ecdsa-sign.c \ ecc-ecdsa-sign.c ecdsa-sign.c \
ecc-ecdsa-verify.c ecdsa-verify.c ecdsa-keygen.c \ ecc-ecdsa-verify.c ecdsa-verify.c ecdsa-keygen.c \
curve25519-base.c \ curve25519-mul-g.c \
$(OPT_HOGWEED_SOURCES) $(OPT_HOGWEED_SOURCES)
HEADERS = aes.h arcfour.h arctwo.h asn1.h blowfish.h \ HEADERS = aes.h arcfour.h arctwo.h asn1.h blowfish.h \
......
/* curve25519-base.c /* curve25519-mul-g.c
Copyright (C) 2014 Niels Möller Copyright (C) 2014 Niels Möller
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
/* Intended to be compatible with NaCl's crypto_scalarmult_base. */ /* Intended to be compatible with NaCl's crypto_scalarmult_base. */
void void
curve25519_base (uint8_t *r, const uint8_t *n) curve25519_mul_g (uint8_t *r, const uint8_t *n)
{ {
uint8_t t[CURVE25519_SIZE]; uint8_t t[CURVE25519_SIZE];
mp_limb_t *scratch; mp_limb_t *scratch;
......
...@@ -39,11 +39,11 @@ extern "C" { ...@@ -39,11 +39,11 @@ extern "C" {
#endif #endif
/* Name mangling */ /* Name mangling */
#define curve25519_base nettle_curve25519_base #define curve25519_mul_g nettle_curve25519_mul_g
#define CURVE25519_SIZE 32 #define CURVE25519_SIZE 32
void void
curve25519_base (uint8_t *q, const uint8_t *n); curve25519_mul_g (uint8_t *q, const uint8_t *n);
#endif /* NETTLE_CURVE25519_H */ #endif /* NETTLE_CURVE25519_H */
...@@ -165,10 +165,10 @@ static void ...@@ -165,10 +165,10 @@ static void
test_g (const uint8_t *s, const uint8_t *r) test_g (const uint8_t *s, const uint8_t *r)
{ {
uint8_t p[CURVE25519_SIZE]; uint8_t p[CURVE25519_SIZE];
curve25519_base (p, s); curve25519_mul_g (p, s);
if (!MEMEQ (CURVE25519_SIZE, p, r)) if (!MEMEQ (CURVE25519_SIZE, p, r))
{ {
printf ("curve25519_base failure:\ns = "); printf ("curve25519_mul_g failure:\ns = ");
print_hex (CURVE25519_SIZE, s); print_hex (CURVE25519_SIZE, s);
printf ("\np = "); printf ("\np = ");
print_hex (CURVE25519_SIZE, p); print_hex (CURVE25519_SIZE, p);
......
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