diff options
author | Micah Elizabeth Scott <beth@torproject.org> | 2023-03-15 12:31:50 -0700 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:38:28 -0700 |
commit | 2de98a7f4ea86c234990747fb566e70fef6aee15 (patch) | |
tree | 56959c6ff781edfe7d88b52fa2dffe60689817b4 /src/test/test_hs_pow_slow.c | |
parent | 287c78c5a82f0447af01f3558748f048c9f3d2b2 (diff) | |
download | tor-2de98a7f4ea86c234990747fb566e70fef6aee15.tar.gz tor-2de98a7f4ea86c234990747fb566e70fef6aee15.zip |
hs_pow: Represent equix_solution as a byte array
This patch is intended to clarify the points at which we convert
between the internal representation of an equix_solution and a portable
but opaque byte array representation.
Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/test/test_hs_pow_slow.c')
-rw-r--r-- | src/test/test_hs_pow_slow.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test_hs_pow_slow.c b/src/test/test_hs_pow_slow.c index 13d7111e88..690ce0cf78 100644 --- a/src/test/test_hs_pow_slow.c +++ b/src/test/test_hs_pow_slow.c @@ -46,9 +46,9 @@ testing_one_hs_pow_solution(const hs_pow_solution_t *ref_solution, expected = 0; } } else if (variant & 1) { - sol_buffer.nonce[variant % HS_POW_NONCE_LEN]++; + sol_buffer.nonce[variant / 2 % HS_POW_NONCE_LEN]++; } else { - sol_buffer.equix_solution.idx[variant % EQUIX_NUM_IDX]++; + sol_buffer.equix_solution[variant / 2 % HS_POW_EQX_SOL_LEN]++; } tt_int_op(expected, OP_EQ, hs_pow_verify(s, &sol_buffer)); |