Home GnuPG

ecc: CHANGE point representation of Curve25519.
dd3d06e7f113Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

ecc: CHANGE point representation of Curve25519.

* cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Decode point with
the prefix 0x40, additional 0x00 by MPI handling, and shorter octets
by MPI normalization.
* cipher/ecc.c (ecc_generate, ecc_encrypt_raw, ecc_decrypt_raw):
Always add the prefix 0x40.

Curve25519 native little-endian point representation is not friendly
to existing practice of OpenPGP code, where MPI is assumed. MPI
handling might insert 0x00 in the beginning to avoid sign confusion.
MPI handling also might remove 0x00s in the front. So, it is safe
to put the prefix 0x40.

While we support old point representation of no prefix in
ecc_mont_decodepoint, new libgcrypt always put the prefix.

Details

Provenance
gniibeAuthored on Dec 5 2015, 2:08 AM
Parents
rC6fadbcd088e2: chacha20: fix alignment of self-test context
Branches
Unknown
Tags
Unknown

Event Timeline

NIIBE Yutaka <gniibe@fsij.org> committed rCdd3d06e7f113: ecc: CHANGE point representation of Curve25519. (authored by NIIBE Yutaka <gniibe@fsij.org>).Dec 5 2015, 2:08 AM