Skip to content

Commit

Permalink
🚨 fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
qd-qd committed Oct 18, 2023
1 parent 9f4bc59 commit 38eeece
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
3 changes: 0 additions & 3 deletions solidity/tests/WebAuthn_forge/test/FCL_ecdsa.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 7 additions & 9 deletions solidity/tests/WebAuthn_forge/test/FCL_elliptic.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 38eeece

Please sign in to comment.