From f1d5eb1da9900ab1435d8bd2f4fdb2353717809b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 25 Mar 2012 19:44:26 +0200 Subject: Add ecc_25519_secret_sanitize stub implementation --- src/ec25519_secret.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/ec25519_secret.c b/src/ec25519_secret.c index 5819a6c..9108613 100644 --- a/src/ec25519_secret.c +++ b/src/ec25519_secret.c @@ -176,3 +176,12 @@ void ecc_25519_secret_mult(ecc_secret_key_256 *out, const ecc_secret_key_256 *in montgomery(out->s, R, C); } +/* TODO implement properly, rule out zero etc. */ +void ecc_25519_secret_sanitize(ecc_secret_key_256 *out, const ecc_secret_key_256 *in) { + int i; + + for (i = 0; i < 32; i++) + out->s[i] = in->s[i]; + + out->s[31] |= 0x80; +} -- cgit v1.2.3