Skip to content

Commit

Permalink
PR feedback: add more wycheproof ECDH test cases
Browse files Browse the repository at this point in the history
Co-authored-by: Sean Andersen <[email protected]>
  • Loading branch information
RandomLattice and andozw committed Oct 17, 2024
1 parent f26c323 commit 3cba981
Show file tree
Hide file tree
Showing 3 changed files with 583 additions and 491 deletions.
4 changes: 1 addition & 3 deletions src/modules/ecdh/tests_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#define SECP256K1_MODULE_ECDH_TESTS_H

static int ecdh_hash_function_test_xpassthru(unsigned char *output, const unsigned char *x, const unsigned char *y, void *data) {
(void)x;
(void)y;
(void)data;
memcpy(output, x, 32);
Expand Down Expand Up @@ -170,8 +169,7 @@ static void test_ecdh_wycheproof(void) {

expected_result = testvectors[t].expected_result;

/* fail if public key is valid, but doesn't parse */
CHECK(parsed_ok || expected_result == 0);
CHECK(parsed_ok == expected_result);

if (!parsed_ok && expected_result == 0) {
continue;
Expand Down
Loading

0 comments on commit 3cba981

Please sign in to comment.