Skip to content
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

Merged
merged 22 commits into from
Jul 7, 2021
Merged

Ristretto #7

merged 22 commits into from
Jul 7, 2021

Conversation

adr1anh
Copy link
Contributor

@adr1anh adr1anh commented Jun 6, 2021

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:

  • remove the ability to issue signatures using shares
  • replaced the party.Set struct with party.IDSlice which wraps a sorted []party.ID
  • marshaling is slightly different as the internal process has been simplified.
  • many public getters have been replaced by publicly accessible struct fields.

Fix issue #6

Fixed issue #6 by returning an error if the length is too short to contain an ID

adr1anh added 7 commits June 6, 2021 15:53
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
@adr1anh adr1anh requested a review from veorq June 6, 2021 14:15
@adr1anh adr1anh marked this pull request as draft June 6, 2021 16:07
@@ -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 {
Copy link
Contributor

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 <= ?

@@ -12,10 +13,10 @@ import (
// ByteSize is the number of bytes required to store and ID or Size
const ByteSize = 2
Copy link
Contributor

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) {
Copy link
Contributor

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 ?

adr1anh added 7 commits June 8, 2021 15:58
- 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.
@adr1anh adr1anh marked this pull request as ready for review July 7, 2021 14:01
@veorq veorq merged commit 4add996 into master Jul 7, 2021
@johandroz johandroz deleted the ristretto branch December 14, 2022 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants