Home GnuPG

ecc: more fix of Curve25519.
48ba5a500666Unpublished

Unpublished Commit · Learn More

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

Description

ecc: more fix of Curve25519.

* cipher/ecc-misc.c (gcry_ecc_mont_decodepoint): Fix removing of
prefix.  Clear the MSB, according to RFC7748.

This change fixes two things.

  • Handle the case the prefix 0x40 comes at the end when scanned as standard MPI.
  • Implement MSB handling. In the page 7 of RFC7748, it says about decoding u-coordinate:

    When receiving such an array, implementations of X25519 (but not X448) MUST mask the most significant bit in the final byte.
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Feb 2 2016, 9:24 AM
Parents
rCa2f9afcd7fcd: ecc: Fix ECDH of Curve25519.
Branches
Unknown
Tags
Unknown

Event Timeline

NIIBE Yutaka <gniibe@fsij.org> committed rC48ba5a500666: ecc: more fix of Curve25519. (authored by NIIBE Yutaka <gniibe@fsij.org>).Feb 2 2016, 9:24 AM