[PATCH] g10: Fix ECDH secret compressed/uncompressed format

Arnaud Fontaine arnaud.fontaine at ssi.gouv.fr
Wed Oct 26 10:55:30 CEST 2016

Le 26/10/2016 10:42, NIIBE Yutaka a écrit :
> On 10/26/2016 05:00 PM, Arnaud Fontaine wrote:
>> Actually, the result my applet is returning is padded with zeros, but after it is
>> received it is stored in the shared_mpi and then copied to secret_x using
>> gcry_mpi_print
>> (g10/ecdh.c line 125), so the leading zeros have disappeared.
>> Adding a prefix could solve this problem, and it would not be a problem to
>> impement it,
>> but I agree with you that it should be addressed in the OpenPGP card
>> specification so that
>> every one will follow the same rule.
> Thank you for your explanation.  I understand the situation.
> So, how about the following?
> * In the OpenPGP card specification
> The result from card should be one of:
>   (1) Standard one, that is:  04 || X || Y
>   (2) Fixed length native x-coordinate only
>       In case of classic ECC, native means big-endian MPI.
>       For X25519, native means little endian.
It ok for me, but 25519 is not supported by the OpenPGP card
specification, right ?

More information about the Gnupg-devel mailing list