-
Notifications
You must be signed in to change notification settings - Fork 16
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
Serialisation additional bits #18
Comments
Great point. Ideally we'd like to specify the serialization format by referencing an existing document, since this draft doesn't seem like the right place to specify low-level details for particular curves. My personal opinion is that this is exactly the kind of thing that the pairing-friendly curves draft should standardize, but there may be another solution. In any case, let's keep this issue open until we figure out who's going to resolve it. |
Frameworks that uses lazy reductions and/or lazy carries and so have redundant representations of their field elements have a I agree that a bit more specification on the serialized format and also standardization of the terminology would be helpful. For example:
The pairing-curve draft does seem like a good place but this is also valid for any signature scheme even if not pairing-based. AFAIK the only normative references somewhat related to IO/serialization are: |
The other normative references I'm aware of for point serialization are:
Also, SEC1 section 2.3 talks about point serialization. |
Issue
BLS12-381 point serialisation is based on zcash. This specifies that the first 3 bits of a G1 / G2 point should be masked away. However it does not discuss the case where a field point is greater than the prime but with the correct number of bytes.
G1
Representation:
Here the first 3 bits of x will represent the: compression, value of y and infinity.
However the first 3 bits of y are not discussed.
G2
Representation: x = a + b * i and y = a + b * i
Here the first 3 bits of x_b will represent the: compression, value of y and infinity.
However the first 3 bits of x_a, y_b, y_a are not discussed.
Possible Solution
I suggest a solution where deserialising a point which has any element greater than the field prime is considered invalid. Otherwise, it is possible to have two different input bytes deserialising to the same point (which may lead to signature malleability depending on implementations).
This may be implied within many implementations however I believe it's worth clarifying.
Note: It is still possible to have G1.x or G2.x_b > the field prime, even masking the first 3 bits.
The text was updated successfully, but these errors were encountered: