ecc: Improve new ECDH API.

Authored by gniibe on Fri, Jun 21, 4:47 AM.

Description

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>

Details

Committed
gniibeFri, Jun 21, 4:47 AM
Parents
rC6d77c2054ea0: ecc: X25519 API change to allow NULL for POINT.
Branches
Unknown
Tags
Unknown
jukivili added inline comments.
/cipher/ecc-ecdh.c
58

Should we check if "algo == GCRY_ECC_CURVE448" here and if not, return zero?

88

Should we check if "algo == GCRY_ECC_CURVE448"? Then return invalid algorithm error code if it isn't.

Thanks for your review.