-
Notifications
You must be signed in to change notification settings - Fork 0
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
Elliptic curve point serialization and FROST group commitment encoding #5
Conversation
The functions allow to serialize elliptic curve point into bytes and deserialize elliptic curve points from bytes. Given FROST requirements during assembling group commitment, it is expected that serialized bytes slice always have the same length.
This function implements section 4.3 of the [FROST] paper. No unit tests were provided and three TODOs are listed in the implementation. This commit should be interpreted as a draft that will be improved in the next commits.
Checking if a point is not the identity element is the requirement of the SerializeElement(A) function. This will be needed to implement encoding of group commitments.
The parameter was unused and the signatures were conflicting with the ones from the Ciphersuite interface.
Introduced validateGroupCommitment function called from validateGroupCommitment that takes care of validating the signer-provided commitments based on [FROST] requirements. Two validations are done: - None of the commitments is the identity element of the curve. - The list of commitments is sorted in ascending order by signer identifier.
|
||
// DeserializePoint deserializes byte slice to an elliptic curve point. The | ||
// byte slice length must be equal to SerializedPointLength(). Otherwise, | ||
// the function returns nil. |
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.
Should we also check that the deserialised points are valid points on the curve?
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.
Addressed in #6.
Remember to check if point is on the curve.
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.
This PR implements code for serializing elliptic curve points and implements FROST group commitment encoding needed in round 2 of the protocol.
The functions serializing and deserializing points expect to always return and accept slice of the same length that is specific to the curve implementation. This allows the FROST group commitment encoding to expect commitments always have a predictable length.