summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ec25519_secret.c9
1 files changed, 9 insertions, 0 deletions
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;
+}