Home GnuPG

ecc: Fix keygrip computation for compressed points.

Description

ecc: Fix keygrip computation for compressed points.

* cipher/ecc-misc.c (_gcry_ecc_ec2os): Factor most code out to ...
(_gcry_ecc_ec2os_buf): new.
* cipher/ecc.c (compute_keygrip): Handle compressed keys.
* tests/keygrip.c: Add new tests.

It is important to get the keygrips right even if we do not have full
support for compressed points. Case in point is that I god a
smartcard which returns the key in compressed format. We need to
early compute the keygrip and use it before doing any computation.

The code has been lifted from _gcry_ecc_sec_decodepoint. We should
factors parts of the code out to a new function.

  • GnuPG-bug-id: T4961
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Mar 24 2021, 9:10 PM
Parents
rC43302b960f54: Compile arch specific GCM implementations only on target arch
Branches
Unknown
Tags
Unknown
Tasks
T4961: ship gpgrt.pc