Closed jayden-sudo closed 11 months ago
Thx for the PR, beware that hardhat environment is not maintained (and there is a code duplication with the /FCL/solidity directory).
Thank you! The goal of this project is to reduce gas consumption while ensuring security. I simply identified some potential gas reduction opportunities in the code and submitted them to the test cases (rather than the formal code). I would like to confirm your thoughts on whether similar optimizations make sense, as I plan to submit PRs with some conventional code optimizations in the coming days.
Also, thanks for your work on P-256!
By the way, we are already trying to use this code to build a test version of the wallet! Link to PR
With the code equivalent, executing ecZZ_mulmuladd_S_asm reduced gas cost by 811 gas:
Testing step:
Open the file: /solidity/tests/WebAuthn_hardhat/test/Webauthn.js
Uncomment line 80: let keyPair = ec.keyFromPrivate( "97ddae0f3a25b92268175400149d65d6887b9cefaf28ea2c078e05cdc15a3c01");
Comment lines 82-83.
npx hardhat test | grep gasused
The purpose of using a fixed key is to perform gas tests with deterministic data.