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.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.c')
-rw-r--r-- | src/test/test_hs_pow.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/test/test_hs_pow.c b/src/test/test_hs_pow.c index edda3cd643..ca470e2b5d 100644 --- a/src/test/test_hs_pow.c +++ b/src/test/test_hs_pow.c @@ -374,12 +374,11 @@ test_hs_pow_vectors(void *arg) tt_int_op(base16_decode((char*)pow_state->seed_previous, HS_POW_SEED_LEN, seed_hex, 2 * HS_POW_SEED_LEN), OP_EQ, HS_POW_SEED_LEN); - tt_int_op(base16_decode((char*)&solution.nonce, sizeof solution.nonce, - nonce_hex, 2 * sizeof solution.nonce), + tt_int_op(base16_decode((char*)solution.nonce, HS_POW_NONCE_LEN, + nonce_hex, 2 * HS_POW_NONCE_LEN), OP_EQ, HS_POW_NONCE_LEN); - tt_int_op(base16_decode((char*)&solution.equix_solution, - sizeof solution.equix_solution, - sol_hex, 2 * sizeof solution.equix_solution), + tt_int_op(base16_decode((char*)solution.equix_solution, HS_POW_EQX_SOL_LEN, + sol_hex, 2 * HS_POW_EQX_SOL_LEN), OP_EQ, HS_POW_EQX_SOL_LEN); memcpy(solution.seed_head, pow_state->seed_previous, HS_POW_SEED_HEAD_LEN); |