-
Notifications
You must be signed in to change notification settings - Fork 751
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVM: Generic BN254 (alt_BN128) Interface for Precompiles / Use @noble…
…/curves By Default (#3564) * Rename BN254 (alt_BN128) interface to match the more generic naming scheme started with BLS * Add bn254 EVM constructor option, use option for existing rustbn.js passing instead of separate constructor parameter * Add a thin wrapper interface around pure rustbn, use interface within createEVM() method * Naming adjustments * Switch over to use Uint8Array as input and output values for the interface, encapsule string conversions for rustbn * One-time WASM initialization fix * Add dummy Noble interface * Add custom (temporary) @noble/curves build to EVM package.json * Rebuild package-lock.json * Temporary fix for conflicting @noble/curves versions * Integrate Noble usage for multiplication * Add generic equalityLengthCheck, moduloLengthCheck methods from BLS utils to precompile utils * Fix test * Minor * Fixes * Add validity assertion for G1 point * Replace equality length check with byte length correction (chop off or right-pad) as stated in EIP * Fixes * Add BN254 add implementation * Add additional pairing modulo length check since not safe to rely on implementation * Some basic alignment * First try on pairing (not working yet) * First pairing tests passing * Fixes * Merge branch 'master' into evm-bn254-precompile-native-js * Update @noble/curves to final v1.5.0 release * Rebuild package-lock.json * Merge branch 'master' into evm-bn254-precompile-native-js * Use plain Noble BN254 by default, clean-up, interface type exports, new --bn254 option for VM test runners (default: rustbn.js) * Move rustbn-wasm dependency over to EVM dev dependencies, add to client dependencies * Rebuild package-lock.json * Integrate in client
- Loading branch information
Showing
31 changed files
with
425 additions
and
123 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.