commit 27b9296909069cec961a8619c5f97721c9580ec6 parent efdeec4fda9f506d59d5649e1726f8e91b96702c Author: Jared Tobin <jared@jtobin.io> Date: Fri, 14 Mar 2025 13:50:51 +0400 test: 'acceptable' cases are invalid to us Diffstat:
M | test/WycheproofEcdh.hs | | | 8 | +++++++- |
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/test/WycheproofEcdh.hs b/test/WycheproofEcdh.hs @@ -34,7 +34,13 @@ execute_group EcdhTestGroup {..} = execute :: EcdhTest -> TestTree execute EcdhTest {..} = H.testCase report $ do case der_to_pub t_public of - Left _ -> H.assertBool "invalid" (t_result == "invalid") + Left _ -> + -- 'acceptable' in wycheproof-speak means that a public key + -- contains a parameter that, whilst invalid, doesn't actually + -- affect the ECDH computation. we work only with valid + -- secp256k1 points, so rule these out as invalid as well. + -- + H.assertBool "invalid" (t_result `elem` ["invalid", "acceptable"]) Right pub -> do let sec = parse_bigint t_private sar = parse_bigint t_shared