-
Notifications
You must be signed in to change notification settings - Fork 15
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
Ristretto #7
Conversation
eddsa.Public - use IDSlice instead of Set - use ristretto for public shares - constructor does not take public key as input. - handle normalization of Shamir shares only where it is used (NewSign) - make members of Public public instead of using getters. eddsaPublicKey: - include verification - add json.Marshal eddsa.SecretShare: - make members public - remove ability to single sign - simplify json marshalling eddsa.Signature - separate encoding/ToEd25519() - computechallenge now uses the ed25519 encoding - remove verification (now in public key)
- lagrange is now called directly on ID - Remove Set struct and use only sorted slices
- sign.base: compute lagrange normalization directly - sign.round2: verify signature explicitly
- remove malicious channel since cofactors are no longer an issue - updates with regards to previous changes
rename MAX to _MAX
pkg/eddsa/signature.go
Outdated
@@ -56,7 +56,7 @@ func (sig *Signature) MarshalBinary() ([]byte, error) { | |||
// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. | |||
func (sig *Signature) UnmarshalBinary(data []byte) error { | |||
var err error | |||
if len(data) != MessageLengthSig { | |||
if len(data) <= MessageLengthSig { |
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.
Shouldnt it be <
instead of <=
?
pkg/frost/party/id.go
Outdated
@@ -12,10 +13,10 @@ import ( | |||
// ByteSize is the number of bytes required to store and ID or Size | |||
const ByteSize = 2 |
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.
Suboptimal naming: ByteSize
without the context sound like "the size of a byte", rename to IDByteSize
?
// TODO quickcheck | ||
} | ||
|
||
func TestRistrettoSmallMultiplesTestVectors(t *testing.T) { |
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.
Maybe add a reference to show that there are the original test vectors, https://ristretto.group/test_vectors/ristretto255.html ?
- Change the name party.ByteSize to party.IDByteSize - add test - rename set.go to idslice.go - return an optional error in Lagrange
Added Header type with more error detection + tests. Remove getters in favor of public fields.
Ristretto group support
After the new update to edwards25519, and the accompanying PR to ristretto255 using these changes, this new PR no longer manipulates edwards25519 points directly.
We include the file ristretto255.go from the PR with a slight modification which allows us to obtain canonical ed25519 representations of ristretto group elements.
This ensures compatibility with ed25519 signature verification, but minimizes the impact of the cofactor while the signing is being
Compatiblity
This update also simplifies the API internally, and requires some modifications to existing use cases. The README.md and examples have been updated to reflect this.
In particular, we changed the following:
party.Set
struct withparty.IDSlice
which wraps a sorted[]party.ID
Fix issue #6
Fixed issue #6 by returning an error if the length is too short to contain an ID