cloudflare / bn256

Package bn256 implements a particular bilinear group.
https://godoc.org/github.com/cloudflare/bn256
BSD 3-Clause "New" or "Revised" License
125 stars 43 forks source link

how to set parameters in constants.go #15

Closed triplewz closed 4 years ago

triplewz commented 4 years ago

Hello, I want to use a new bn curve (y^2=x^3+b) with the following parameters:

b:5
u:600000000058F98A
p(u)=36u⁴+36u³+24u²+6u+1
p:B640000002A3A6F1D603AB4FF58EC74521F2934B1A7AEEDBE56F9B27E351457D
n(u)=36u⁴+36u³+18u²+6u+1
n:B640000002A3A6F1D603AB4FF58EC74449F2934B18EA8BEEE56EE19CD69ECF25
G1x:93DE051D62BF718FF5ED0704487D01D6E1E4086909DC3280E8C4E4817C66DDDD
G1y:21FE8DDA4F21E607631065125C395BBC1C1C00CBFA6024350C464CD70A3EA616
F(p^2)=Fp(i),where i^2 = -2

How to set the parameters? Thanks.

Bren2010 commented 4 years ago

The formulas for all the constants are given in the inline comments. I've attached some unpublished code I found that may or may not be helpful in this endeavor.

genconsts.zip

triplewz commented 4 years ago

thanks.