From f1c56e74805fd0f6268c5d1a899f96b32b912c83 Mon Sep 17 00:00:00 2001 From: cathugger Date: Tue, 2 Nov 2021 17:32:10 +0200 Subject: [PATCH] idk --- worker.c | 6 +++--- worker_batch.inc.h | 4 ++++ worker_batch_pass.inc.h | 4 ++++ worker_fast.inc.h | 4 ++++ worker_fast_pass.inc.h | 4 ++++ worker_slow.inc.h | 4 ++++ 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/worker.c b/worker.c index f0aaf62..818413c 100644 --- a/worker.c +++ b/worker.c @@ -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. ge_p3 ALIGN(16) point; u8 testpk[PUBLIC_LEN]; - ge_scalarmult_base(&point, secret); - ge_p3_tobytes(testpk, &point); - if (!memcmp(testpk, pubonion, PUBLIC_LEN)) + ge_scalarmult_base(&point,secret); + ge_p3_tobytes(testpk,&point); + if (!memcmp(testpk,pubonion,PUBLIC_LEN)) abort(); #endif diff --git a/worker_batch.inc.h b/worker_batch.inc.h index 508f7ab..2e0788f 100644 --- a/worker_batch.inc.h +++ b/worker_batch.inc.h @@ -38,6 +38,7 @@ void *worker_batch(void *task) sname = makesname(); initseed: + #ifdef STATISTICS ++st->numrestart.v; #endif @@ -114,8 +115,11 @@ initseed: end: free(sname); + POSTFILTER + sodium_memzero(secret,sizeof(secret)); sodium_memzero(seed,sizeof(seed)); + return 0; } diff --git a/worker_batch_pass.inc.h b/worker_batch_pass.inc.h index 74320a4..5f07c70 100644 --- a/worker_batch_pass.inc.h +++ b/worker_batch_pass.inc.h @@ -39,6 +39,7 @@ void *worker_batch_pass(void *task) sname = makesname(); initseed: + #ifdef STATISTICS ++st->numrestart.v; #endif @@ -191,9 +192,12 @@ initseed: end: free(sname); + POSTFILTER + sodium_memzero(secret,sizeof(secret)); sodium_memzero(seed,sizeof(seed)); + return 0; } #endif // PASSPHRASE diff --git a/worker_fast.inc.h b/worker_fast.inc.h index 141a34b..1d7443f 100644 --- a/worker_fast.inc.h +++ b/worker_fast.inc.h @@ -33,6 +33,7 @@ void *worker_fast(void *task) sname = makesname(); initseed: + #ifdef STATISTICS ++st->numrestart.v; #endif @@ -96,8 +97,11 @@ initseed: end: free(sname); + POSTFILTER + sodium_memzero(secret,sizeof(secret)); sodium_memzero(seed,sizeof(seed)); + return 0; } diff --git a/worker_fast_pass.inc.h b/worker_fast_pass.inc.h index 2d482b3..132aed6 100644 --- a/worker_fast_pass.inc.h +++ b/worker_fast_pass.inc.h @@ -34,6 +34,7 @@ void *worker_fast_pass(void *task) sname = makesname(); initseed: + #ifdef STATISTICS ++st->numrestart.v; #endif @@ -104,9 +105,12 @@ initseed: end: free(sname); + POSTFILTER + sodium_memzero(secret,sizeof(secret)); sodium_memzero(seed,sizeof(seed)); + return 0; } #endif // PASSPHRASE diff --git a/worker_slow.inc.h b/worker_slow.inc.h index 2df8930..278b58b 100644 --- a/worker_slow.inc.h +++ b/worker_slow.inc.h @@ -33,6 +33,7 @@ void *worker_slow(void *task) initseed: randombytes(seed,sizeof(seed)); ed25519_seckey_expand(sk,seed); + #ifdef STATISTICS ++st->numrestart.v; #endif @@ -83,8 +84,11 @@ next: end: free(sname); + POSTFILTER + sodium_memzero(secret,sizeof(secret)); sodium_memzero(seed,sizeof(seed)); + return 0; }