diff --git a/solidity/tests/WebAuthn_forge/test/FCL_ecdsa.t.sol b/solidity/tests/WebAuthn_forge/test/FCL_ecdsa.t.sol index 8bd07af9..89f5deb8 100644 --- a/solidity/tests/WebAuthn_forge/test/FCL_ecdsa.t.sol +++ b/solidity/tests/WebAuthn_forge/test/FCL_ecdsa.t.sol @@ -30,9 +30,6 @@ import "@external/ECops.sol"; //echo "itsakindofmagic" | sha256sum, used as a label to find precomputations inside bytecode uint256 constant _MAGIC_ENCODING = 0x9a8295d6f225e4f07313e2e1440ab76e26d4c6ed2d1eb4cbaa84827c8b7caa8d; - - - // library elliptic solidity from orbs network contract wrap_ecdsa_orbs { uint256 constant gx = 0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296; diff --git a/solidity/tests/WebAuthn_forge/test/FCL_elliptic.t.sol b/solidity/tests/WebAuthn_forge/test/FCL_elliptic.t.sol index e89001c6..bdbfda88 100644 --- a/solidity/tests/WebAuthn_forge/test/FCL_elliptic.t.sol +++ b/solidity/tests/WebAuthn_forge/test/FCL_elliptic.t.sol @@ -168,28 +168,26 @@ contract ArithmeticTest is Test { assertEq(radd, raddN); } - function test_Fuzz_SigVerif(uint256 k, uint256 kpriv, uint256 message) public - { + function test_Fuzz_SigVerif(uint256 k, uint256 kpriv, uint256 message) public { vm.assume(k < FCL_Elliptic_ZZ.n); vm.assume(k > 1); vm.assume(kpriv < FCL_Elliptic_ZZ.n); vm.assume(kpriv > 1); - + vm.assume(message < FCL_Elliptic_ZZ.n); vm.assume(message > 1); - uint256 xpub=FCL_Elliptic_ZZ.ecZZ_mulmuladd_S_asm(0,0, kpriv, 0); //deriv public key + uint256 xpub = FCL_Elliptic_ZZ.ecZZ_mulmuladd_S_asm(0, 0, kpriv, 0); //deriv public key uint256 ypub = FCL_Elliptic_ZZ.ec_Decompress(xpub, 0); uint256 r; uint256 s; assertEq(FCL_Elliptic_ZZ.ecAff_isOnCurve(xpub, ypub), true); - (r,s)= FCL_Elliptic_ZZ.ecdsa_sign(bytes32(message), k, kpriv); - + (r, s) = FCL_Elliptic_ZZ.ecdsa_sign(bytes32(message), k, kpriv); - bool res1=FCL_Elliptic_ZZ.ecdsa_verify(bytes32(message), r,s, xpub, ypub); - bool res2=FCL_Elliptic_ZZ.ecdsa_verify(bytes32(message), r,s, xpub, p-ypub); - bool res=res1||res2; + bool res1 = FCL_Elliptic_ZZ.ecdsa_verify(bytes32(message), r, s, xpub, ypub); + bool res2 = FCL_Elliptic_ZZ.ecdsa_verify(bytes32(message), r, s, xpub, p - ypub); + bool res = res1 || res2; assertEq(res, true); }