summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorMicah Elizabeth Scott <beth@torproject.org>2023-03-14 16:16:27 -0700
committerMicah Elizabeth Scott <beth@torproject.org>2023-05-10 07:38:28 -0700
commit209a59face791159e167837214e22b6eaa3375b4 (patch)
tree69b17b24100bc301dec12df57f016e14b3534e7f /src/test
parent1a3afeb387461680bcf97f5cf8574ee0e0cad893 (diff)
downloadtor-209a59face791159e167837214e22b6eaa3375b4.tar.gz
tor-209a59face791159e167837214e22b6eaa3375b4.zip
hs_pow: Don't require uint128_t
We were using a native uint128_t to represent the hs_pow nonce, but as the comments note it's more portable and more flexible to use a byte array. Indeed the uint128_t was a problem for 32-bit platforms. This swaps in a new implementation that uses multiple machine words to implement the nonce incrementation. Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_hs_pow_slow.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test_hs_pow_slow.c b/src/test/test_hs_pow_slow.c
index 8ccbf8025c..716501dffd 100644
--- a/src/test/test_hs_pow_slow.c
+++ b/src/test/test_hs_pow_slow.c
@@ -48,7 +48,7 @@ testing_one_hs_pow_solution(const hs_pow_solution_t *ref_solution,
expected = 0;
}
} else if (variant & 1) {
- sol_buffer.nonce += variant;
+ sol_buffer.nonce[variant % HS_POW_NONCE_LEN]++;
} else {
sol_buffer.equix_solution.idx[variant % EQUIX_NUM_IDX]++;
}