-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot import scalar values from BLS12-381 Ethereum test suite #9
Comments
If I check the second test, which has scalar value Could this have to do with the hex string starting with the character 'b'? |
Other values, including those not starting with 'a-f' characters, do not seem to import. Converting the values to decimals also fails. |
If you want BLS12-381 for Ethereum, then I think it is better to use bls-eth-wasm. |
Hey there. I think there might be some confusion here. I am referring to this EIP, which is supposed to get included in the next hard fork of Ethereum 1.0. This indeed has BLS curves which ETH 2.0 also appears to use. However, for Ethereum 1.0, we need some low-level calls to these curves. Specifically, we need G1/2 addition, multiplication and multi-multiplication (mulVec), pairing operations, and the mapToG1 and mapToG2 functions for these curves. The |
mcl.Fr() is a finite field class of the prime r. |
Hey @herumi, this indeed works! It also looks (at least for this single test case) as it returns the expected value. Thanks a lot! |
Hi there. At EthereumJS-VM we are using this library in order to get the EIP 2537 in the VM (the BLS12-381 EIP).
Currently, I am struggling importing the first test case of this EIP. The input value has 128 bytes of G1 point data (i.e. the coordinates, first 64 bytes and second 64 bytes are the coordinate x,y-values) and the final 32 bytes are the scalar value we want to multiply with.
Here is the code:
Problem: this throws:
According to the test, this value should be correct. If I try the scalar2 value, which was generated by
setCSPRNG
then it runs fine.The text was updated successfully, but these errors were encountered: