This commit is contained in:
cathugger 2021-11-02 17:32:10 +02:00
parent 7dea621e41
commit f1c56e7480
No known key found for this signature in database
GPG key ID: 9BADDA2DAF6F01A8
6 changed files with 23 additions and 3 deletions

View file

@ -98,9 +98,9 @@ static void onionready(char *sname,const u8 *secret,const u8 *pubonion)
// Sanity check that the public key matches the private one. // Sanity check that the public key matches the private one.
ge_p3 ALIGN(16) point; ge_p3 ALIGN(16) point;
u8 testpk[PUBLIC_LEN]; u8 testpk[PUBLIC_LEN];
ge_scalarmult_base(&point, secret); ge_scalarmult_base(&point,secret);
ge_p3_tobytes(testpk, &point); ge_p3_tobytes(testpk,&point);
if (!memcmp(testpk, pubonion, PUBLIC_LEN)) if (!memcmp(testpk,pubonion,PUBLIC_LEN))
abort(); abort();
#endif #endif

View file

@ -38,6 +38,7 @@ void *worker_batch(void *task)
sname = makesname(); sname = makesname();
initseed: initseed:
#ifdef STATISTICS #ifdef STATISTICS
++st->numrestart.v; ++st->numrestart.v;
#endif #endif
@ -114,8 +115,11 @@ initseed:
end: end:
free(sname); free(sname);
POSTFILTER POSTFILTER
sodium_memzero(secret,sizeof(secret)); sodium_memzero(secret,sizeof(secret));
sodium_memzero(seed,sizeof(seed)); sodium_memzero(seed,sizeof(seed));
return 0; return 0;
} }

View file

@ -39,6 +39,7 @@ void *worker_batch_pass(void *task)
sname = makesname(); sname = makesname();
initseed: initseed:
#ifdef STATISTICS #ifdef STATISTICS
++st->numrestart.v; ++st->numrestart.v;
#endif #endif
@ -191,9 +192,12 @@ initseed:
end: end:
free(sname); free(sname);
POSTFILTER POSTFILTER
sodium_memzero(secret,sizeof(secret)); sodium_memzero(secret,sizeof(secret));
sodium_memzero(seed,sizeof(seed)); sodium_memzero(seed,sizeof(seed));
return 0; return 0;
} }
#endif // PASSPHRASE #endif // PASSPHRASE

View file

@ -33,6 +33,7 @@ void *worker_fast(void *task)
sname = makesname(); sname = makesname();
initseed: initseed:
#ifdef STATISTICS #ifdef STATISTICS
++st->numrestart.v; ++st->numrestart.v;
#endif #endif
@ -96,8 +97,11 @@ initseed:
end: end:
free(sname); free(sname);
POSTFILTER POSTFILTER
sodium_memzero(secret,sizeof(secret)); sodium_memzero(secret,sizeof(secret));
sodium_memzero(seed,sizeof(seed)); sodium_memzero(seed,sizeof(seed));
return 0; return 0;
} }

View file

@ -34,6 +34,7 @@ void *worker_fast_pass(void *task)
sname = makesname(); sname = makesname();
initseed: initseed:
#ifdef STATISTICS #ifdef STATISTICS
++st->numrestart.v; ++st->numrestart.v;
#endif #endif
@ -104,9 +105,12 @@ initseed:
end: end:
free(sname); free(sname);
POSTFILTER POSTFILTER
sodium_memzero(secret,sizeof(secret)); sodium_memzero(secret,sizeof(secret));
sodium_memzero(seed,sizeof(seed)); sodium_memzero(seed,sizeof(seed));
return 0; return 0;
} }
#endif // PASSPHRASE #endif // PASSPHRASE

View file

@ -33,6 +33,7 @@ void *worker_slow(void *task)
initseed: initseed:
randombytes(seed,sizeof(seed)); randombytes(seed,sizeof(seed));
ed25519_seckey_expand(sk,seed); ed25519_seckey_expand(sk,seed);
#ifdef STATISTICS #ifdef STATISTICS
++st->numrestart.v; ++st->numrestart.v;
#endif #endif
@ -83,8 +84,11 @@ next:
end: end:
free(sname); free(sname);
POSTFILTER POSTFILTER
sodium_memzero(secret,sizeof(secret)); sodium_memzero(secret,sizeof(secret));
sodium_memzero(seed,sizeof(seed)); sodium_memzero(seed,sizeof(seed));
return 0; return 0;
} }