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>