ecc: Improve new ECDH API.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 21 Jun 2019 02:47:33 +0000 (11:47 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 21 Jun 2019 02:47:33 +0000 (11:47 +0900)
commita658c9ccc2c741f40b0b5cdbcd184cfb9a841d17
treece0592356ad72bb7e6c28af8fc53d6f7b7e83696
parent6d77c2054ea0358fb4c6f59b4c91c673c0a83b03
ecc: Improve new ECDH API.

* cipher/ecc-ecdh.c (_gcry_ecc_get_algo_keylen): New.
(_gcry_ecc_mul_point): Fill into the RESULT buffer, instead of
allocating new buffer.
* src/gcrypt-int.h: Change the API.
* src/gcrypt.h.in: Likewise.
* src/libgcrypt.def (gcry_ecc_get_algo_keylen): New.
* src/libgcrypt.vers (gcry_ecc_get_algo_keylen): New.
* src/visibility.c (gcry_ecc_get_algo_keylen): New.
* src/visibility.h (gcry_ecc_get_algo_keylen): New.
* tests/t-cv25519.c: Fix the use case.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
cipher/ecc-ecdh.c
src/gcrypt-int.h
src/gcrypt.h.in
src/libgcrypt.def
src/libgcrypt.vers
src/visibility.c
src/visibility.h
tests/t-cv25519.c