ethsnarks icon indicating copy to clipboard operation
ethsnarks copied to clipboard

align compression func with doc description

Open yueawang opened this issue 3 years ago • 0 comments

Hi, HarryR

I found the point compression code is inconsistent with the doc description, so I make some change based on https://ed25519.cr.yp.to/eddsa-20150704.pdf.

changes are:

specifically, x is negative if the (b − 1)-bit encoding of x is lexicographically larger than the (b − 1)-bit encoding of −x.

and

This encoding is also used to define a b-bit encoding of each element (x, y) ∈ E as a b-bit string (x, y), namely the (b − 1)-bit encoding of y followed by a sign bit; the sign bit is 1 if and only if x is negative.

Please correct me if I am wrong. Thanks!

Signed-off-by: yue.wang [email protected]

yueawang avatar Oct 01 '20 14:10 yueawang