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

docs: added comments for the splitting of S in eddsa #89

Merged
merged 1 commit into from Apr 16, 2021
Merged

Conversation

ThomasPiellard
Copy link
Collaborator

In EdDSA, the S scalar in the signature is now split in 2, to prevent overflowing --> S should NOT be reduced modulo r, the size of the snark field. So if n is the bit length of r, S is split in S1, S2 such that S = 2^(n/2)S1+S2, so S1 and S2 are the digits of S in basis 2^(n/2).

Breaking changes

The signature struct is now

type Signature struct {
	R      twistededwards.Point
	S1, S2 frontend.Variable // --> instead of: S frontend.Variable
}

Examples of how to properly split S given a signature is in std/signature/eddsa/eddsa_test.go. If r is n-bits long, splitting S amounts to take the first n/2 bits of the part of the signature corresponding to S for S1, and the last n/2 bits of the part of the signature corresponding to S for S2 (the signature is a byte slice point||S, the first n-bits chunk is the compressed point, the last bits are S).

@gbotrel gbotrel merged commit 7b065e2 into develop Apr 16, 2021
@gbotrel gbotrel deleted the fix/eddsa branch April 16, 2021 20:13
@gbotrel
Copy link
Collaborator

gbotrel commented Apr 16, 2021

See also #88

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.

None yet

2 participants