diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2019-06-20 09:58:01 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2019-06-20 09:58:01 +0900 |
commit | ec8c2cdf977aa8d9ca5af0a9bd25aeb9190570b3 (patch) | |
tree | 6d023343f8aa7e8a9154252d3e6d266ff0a7b7d7 /cipher/ecc-eddsa.c | |
parent | 971d372f512ff6805d5b8b54e9ac1446f3f66643 (diff) | |
download | libgcrypt-ec8c2cdf977aa8d9ca5af0a9bd25aeb9190570b3.tar.gz |
ecc: Add an API for X25519 function as gcry_ecc_mul_point.
* configure.ac: Add ecc-ecdh.lo.
* cipher/Makefile.am: Add ecc-ecdh.c.
* cipher/ecc-common.h (reverse_buffer): Expose.
* cipher/ecc-eddsa.c (reverse_buffer): Expose.
* cipher/ecc-curves.c (domain_parms): Fix as the errata of RFC.
* cipher/ecc-ecdh.c: New.
* cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Fix for other curves
than Curve25519.
* src/gcrypt-int.h (_gcry_ecc_mul_point): New.
* src/gcrypt.h.in (enum gcry_ecc_curves): New.
(gcry_ecc_mul_point): new.
* src/libgcrypt.def (gcry_ecc_mul_point): New.
* src/libgcrypt.vers (gcry_ecc_mul_point): New.
* src/visibility.h (gcry_ecc_mul_point): New.
* src/visibility.c (gcry_ecc_mul_point): New.
* tests/t-cv25519.c (test_cv_hl): Rename from test_cv.
(test_cv_x25519): New.
(test_cv): Call both of test_cv_hl and test_cv_x25519.
--
Add new API gcry_ecc_mul_point for direct use of X25519 function.
"Direct use" means, its inputs and output are binary octet in native
format, while no lengths check inside. It's a responsibility of
caller.
We can use gcry_pk_encrypt for implementing X25519, but the API of
gcry_pk_encrypt uses SEXP format, which is a bit cumbersome.
GnuPG-bug-id: 4293
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/ecc-eddsa.c')
-rw-r--r-- | cipher/ecc-eddsa.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c index 89b708a0..3850946a 100644 --- a/cipher/ecc-eddsa.c +++ b/cipher/ecc-eddsa.c @@ -32,7 +32,7 @@ -static void +void reverse_buffer (unsigned char *buffer, unsigned int length) { unsigned int tmp, i; |