mirror of
https://github.com/cathugger/mkp224o.git
synced 2025-04-21 06:19:09 +00:00
cleanup right side reseed
This commit is contained in:
parent
226f047aef
commit
db303cf8f6
1 changed files with 3 additions and 6 deletions
9
main.c
9
main.c
|
@ -475,9 +475,6 @@ initseed:
|
||||||
pthread_mutex_unlock(&determseed_mutex);
|
pthread_mutex_unlock(&determseed_mutex);
|
||||||
ed25519_seckey_expand(sk,seed);
|
ed25519_seckey_expand(sk,seed);
|
||||||
|
|
||||||
// reseed right half of key with some random data to have more entropy
|
|
||||||
reseedright(sk);
|
|
||||||
|
|
||||||
#ifdef STATISTICS
|
#ifdef STATISTICS
|
||||||
++st->numrestart.v;
|
++st->numrestart.v;
|
||||||
#endif
|
#endif
|
||||||
|
@ -512,6 +509,9 @@ initseed:
|
||||||
if ((sk[0] & 248) != sk[0] || ((sk[31] & 63) | 64) != sk[31])
|
if ((sk[0] & 248) != sk[0] || ((sk[31] & 63) | 64) != sk[31])
|
||||||
goto initseed;
|
goto initseed;
|
||||||
|
|
||||||
|
// reseed right half of key to avoid reuse, it won't change public key anyway
|
||||||
|
reseedright(sk);
|
||||||
|
|
||||||
ADDNUMSUCCESS;
|
ADDNUMSUCCESS;
|
||||||
|
|
||||||
// calc checksum
|
// calc checksum
|
||||||
|
@ -523,9 +523,6 @@ initseed:
|
||||||
strcpy(base32_to(&sname[direndpos],pk,PUBONION_LEN),".onion");
|
strcpy(base32_to(&sname[direndpos],pk,PUBONION_LEN),".onion");
|
||||||
onionready(sname,secret,pubonion.raw);
|
onionready(sname,secret,pubonion.raw);
|
||||||
pk[PUBLIC_LEN] = 0; // what is this for?
|
pk[PUBLIC_LEN] = 0; // what is this for?
|
||||||
|
|
||||||
// reseed right half of key to avoid reuse, it won't change public key anyway
|
|
||||||
reseedright(sk);
|
|
||||||
});
|
});
|
||||||
next:
|
next:
|
||||||
ge_add(&sum, &ge_public,&ge_eightpoint);
|
ge_add(&sum, &ge_public,&ge_eightpoint);
|
||||||
|
|
Loading…
Add table
Reference in a new issue