mirror of
https://github.com/neocturne/libuecc.git
synced 2025-03-04 09:03:31 +01:00
Add ecc_25519_secret_sanitize stub implementation
This commit is contained in:
parent
89d237f36b
commit
f1d5eb1da9
2 changed files with 10 additions and 0 deletions
|
@ -57,5 +57,6 @@ void ecc_25519_secret_add(ecc_secret_key_256 *out, const ecc_secret_key_256 *in1
|
|||
void ecc_25519_secret_sub(ecc_secret_key_256 *out, const ecc_secret_key_256 *in1, const ecc_secret_key_256 *in2);
|
||||
void ecc_25519_secret_reduce(ecc_secret_key_256 *out, const ecc_secret_key_256 *in);
|
||||
void ecc_25519_secret_mult(ecc_secret_key_256 *out, const ecc_secret_key_256 *in1, const ecc_secret_key_256 *in2);
|
||||
void ecc_25519_secret_sanitize(ecc_secret_key_256 *out, const ecc_secret_key_256 *in);
|
||||
|
||||
#endif /* _LIBUECC_ECC_H_ */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue