# HG changeset patch # User Kim Alvefur # Date 1664490430 -7200 # Node ID 924bc1c8d0d9ec3c90b28a4d97008d62813ccd38 # Parent ad4ab01f9b1171907621e02cdb62f18bf1178ce1 util.crypto: Fix tests Found this number in a hat. Sleepy time. Good night. diff -r ad4ab01f9b11 -r 924bc1c8d0d9 spec/util_crypto_spec.lua --- a/spec/util_crypto_spec.lua Thu Sep 29 23:17:42 2022 +0100 +++ b/spec/util_crypto_spec.lua Fri Sep 30 00:27:10 2022 +0200 @@ -117,7 +117,7 @@ 6b0cd1043718ffc31c153b971d213a8e ]]):gsub("%s+", ""))); it("can be parsed", function () - local r, s = crypto.parse_ecdsa_signature(sig); + local r, s = crypto.parse_ecdsa_signature(sig, 32); assert.is_string(r); assert.is_string(s); assert.equal(32, #r); @@ -134,13 +134,13 @@ string.rep("\255", 3); }; for _, invalid_sig in ipairs(invalid_sigs) do - local r, s = crypto.parse_ecdsa_signature(invalid_sig); + local r, s = crypto.parse_ecdsa_signature(invalid_sig, 32); assert.is_nil(r); assert.is_nil(s); end end); it("can be built", function () - local r, s = crypto.parse_ecdsa_signature(sig); + local r, s = crypto.parse_ecdsa_signature(sig, 32); local rebuilt_sig = crypto.build_ecdsa_signature(r, s); assert.equal(sig, rebuilt_sig); end);