Home GnuPG

ecc: Fix ECDH of Curve25519.
a2f9afcd7fcdUnpublished

Unpublished Commit · Learn More

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

Description

ecc: Fix ECDH of Curve25519.

* cipher/ecc-misc.c (_gcry_ecc_mont_decodepoint): Fix calc of NBITS
and prefix detection.
* cipher/ecc.c (ecc_generate): Use NBITS instead of CTX->NBITS.
(ecc_encrypt_raw): Use NBITS from curve instead of from P.
Fix rawmpilen calculation.
(ecc_decrypt_raw): Likewise.  Add debug output.

This fixes the commit dd3d06e7. NBITS is defined 256 in ecc-curves.c,
thus, ecc_get_nbits returns 256. But CTX->NBITS has 255 for Montgomery
curve.

Details

Provenance
gniibeAuthored on Feb 2 2016, 5:58 AM
Parents
rC57b60bb1718b: Update 'Interface changes' in NEWS
Branches
Unknown
Tags
Unknown

Event Timeline

NIIBE Yutaka <gniibe@fsij.org> committed rCa2f9afcd7fcd: ecc: Fix ECDH of Curve25519. (authored by NIIBE Yutaka <gniibe@fsij.org>).Feb 2 2016, 5:58 AM