Home GnuPG

cipher:ecc: Support gcry_pk_hash_sign/verify for EdDSA.

Description

cipher:ecc: Support gcry_pk_hash_sign/verify for EdDSA.

* cipher/pubkey.c (prepare_datasexp_to_be_signed): Allow HD=NULL,
and use of CTX for supplying input data and random_override.
(_gcry_pk_sign_md, _gcry_pk_verify_md): Support the case of HD==NULL.
(release_single_data): New.
(_gcry_pk_single_data_push, _gcry_pk_get_single_data): New.
(_gcry_pk_random_override_new, _gcry_pk_get_random_override): Remove.
* src/context.h (CONTEXT_TYPE_SINGLE_DATA): New.
(CONTEXT_TYPE_RANDOM_OVERRIDE): Remove.
* src/context.c (_gcry_ctx_alloc): Use CONTEXT_TYPE_SINGLE_DATA.
* src/gcrypt-int.h (_gcry_pk_single_data_push,
_gcry_pk_get_single_data): New.
(_gcry_pk_random_override_new, _gcry_pk_get_random_override): Remove.
* src/gcrypt.h.in (gcry_pk_input_data_push): New.
* src/visibility.c (gcry_pk_random_override_new): Follow the change.
* tests/t-ed25519.c (one_test): Use gcry_pk_hash_sign/verify API.
* tests/t-ed448.c (one_test): Use gcry_pk_hash_sign/verify API.
  • GnuPG-bug-id: T6511
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Jun 14 2023, 7:50 AM
Parents
rC469919751d6e: cipher:ecc: Fix public key computation for EdDSA.
Branches
Unknown
Tags
Unknown
Tasks
T6511: EdDSA support in FIPS mode