mirror of
https://github.com/neocturne/libuecc.git
synced 2025-03-04 17:03:31 +01:00
Add a better explanation to ecc_25519_gf_sanitize_secret()
This commit is contained in:
parent
68821f6b8f
commit
2320e02317
1 changed files with 4 additions and 0 deletions
|
@ -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
|
* 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.
|
* 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) {
|
void ecc_25519_gf_sanitize_secret(ecc_int256_t *out, const ecc_int256_t *in) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue