-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Update BLS test suite to BLS standard draft v2 format #1813
Conversation
1. Make sure that BLS -Verify APIs would only return `True` or `False` , no exceptions. 2. Use `eth2spec.utils.bls` instead of py_ecc for test generator 3. Add assertions in test generator 4. Add some special test cases for the -Verify APIs 5. Clean up the test format documents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have test cases that are throwing?
The In the BLS standard spec:
I added |
is this not defined in the ietf spec? |
The result is defined as "INVALID", and I can't find the formal definition of INVALID from the spec. Just looked around other implementations:
We only use Update: addressed it in ab3cbda Update 2: |
I think that it is better
|
Specifically, the spec has a precondition that n>=1 so I think there is some lenience in implementation here. Personally, I feel that the type of
This assumes that the point at infinity is mapped to 0, which is not necessarily the case. The encoding of a point uses the second most significant bit in addition to all zeros to encode infinity. |
Yes, "zero signature" means inifinity. The array of zero bytes is my library's internal representaion, which is converted to |
@herumi @CarlBeek thanks for the reply! I understand the standard v.s. usability tradeoff that you both mentioned. We have made explicit handling in Eth2 spec to avoid So I think it's correct that py_ecc & milagro-rust throw Error/Exception and handle the error in client implementation. As for herumi-bls, for safety, maybe the Eth2 clients can add a wrapper to throw an exception or handle As for the test vector, I'm inclined to return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
At this point, I'm down to just follow IETF which it seems like our interpretation of Aggregate([])
does so
Okay, I'll modify Go/Rust/WebAssembly binding of my library to throw an exception. |
True
orFalse
, no exceptions.eth2spec.utils.bls
wrapper instead ofpy_ecc
for test generator (I'm worried about that it's possiblepy_ecc
throwsException
s)