From 2320e0231759d889c40fbbcb384a2df2236a2497 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 26 Jan 2015 05:53:39 +0100 Subject: Add a better explanation to ecc_25519_gf_sanitize_secret() --- src/ec25519_gf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ec25519_gf.c b/src/ec25519_gf.c index 91fa320..4914fa7 100644 --- a/src/ec25519_gf.c +++ b/src/ec25519_gf.c @@ -271,6 +271,10 @@ void ecc_25519_gf_recip(ecc_int256_t *out, const ecc_int256_t *in) { /** * Ensures some properties of a Galois field element to make it fit for use as a secret key * + * This sets the 255th bit and clears the 256th and the bottom three bits (so the key + * will be a multiple of 8). See Daniel J. Bernsteins paper "Curve25519: new Diffie-Hellman speed records." + * for the rationale of this. + * * The same pointers may be used for input and output. */ void ecc_25519_gf_sanitize_secret(ecc_int256_t *out, const ecc_int256_t *in) { -- cgit v1.2.3