github.com/consensys/gnark-crypto@v0.14.0/internal/generator/config/bn254.go (about)

     1  package config
     2  
     3  var BN254 = Curve{
     4  	Name:         "bn254",
     5  	CurvePackage: "bn254",
     6  	EnumID:       "BN254",
     7  	FrModulus:    "21888242871839275222246405745257275088548364400416034343698204186575808495617",
     8  	FpModulus:    "21888242871839275222246405745257275088696311157297823662689037894645226208583",
     9  	G1: Point{
    10  		CoordType:        "fp.Element",
    11  		CoordExtDegree:   1,
    12  		PointName:        "g1",
    13  		GLV:              true,
    14  		CofactorCleaning: false,
    15  		CRange:           defaultCRange(),
    16  	},
    17  	G2: Point{
    18  		CoordType:        "fptower.E2",
    19  		CoordExtDegree:   2,
    20  		PointName:        "g2",
    21  		GLV:              true,
    22  		CofactorCleaning: true,
    23  		CRange:           defaultCRange(),
    24  		Projective:       true,
    25  	},
    26  	HashE1: &HashSuiteSvdw{
    27  		z:  []string{"1"},
    28  		c1: []string{"4"},
    29  		c2: []string{"10944121435919637611123202872628637544348155578648911831344518947322613104291"},
    30  		c3: []string{"8815841940592487685674414971303048083897117035520822607866"},
    31  		c4: []string{"7296080957279758407415468581752425029565437052432607887563012631548408736189"},
    32  	},
    33  	HashE2: &HashSuiteSvdw{
    34  		z: []string{
    35  			"1",
    36  			"0",
    37  		},
    38  		c1: []string{
    39  			"19485874751759354771024239261021720505790618469301721065564631296452457478374",
    40  			"266929791119991161246907387137283842545076965332900288569378510910307636690",
    41  		},
    42  		c2: []string{
    43  			"10944121435919637611123202872628637544348155578648911831344518947322613104291",
    44  			"0",
    45  		},
    46  		c3: []string{
    47  			"18992192239972082890849143911285057164064277369389217330423471574879236301292",
    48  			"21819008332247140148575583693947636719449476128975323941588917397607662637108",
    49  		},
    50  		c4: []string{
    51  			"10499238450719652342378357227399831140106360636427411350395554762472100376473",
    52  			"6940174569119770192419592065569379906172001098655407502803841283667998553941",
    53  		},
    54  	},
    55  }
    56  
    57  var tBN254 = TwistedEdwardsCurve{
    58  	Name:     BN254.Name,
    59  	Package:  "twistededwards",
    60  	EnumID:   BN254.EnumID,
    61  	A:        "-1",
    62  	D:        "12181644023421730124874158521699555681764249180949974110617291017600649128846",
    63  	Cofactor: "8",
    64  	Order:    "2736030358979909402780800718157159386076813972158567259200215660948447373041",
    65  	BaseX:    "9671717474070082183213120605117400219616337014328744928644933853176787189663",
    66  	BaseY:    "16950150798460657717958625567821834550301663161624707787222815936182638968203",
    67  }
    68  
    69  func init() {
    70  	addCurve(&BN254)
    71  	addTwistedEdwardCurve(&tBN254)
    72  }