~ubuntu-branches/ubuntu/vivid/juju-core/vivid-proposed

« back to all changes in this revision

Viewing changes to src/code.google.com/p/go.crypto/bn256/constants.go

  • Committer: Package Import Robot
  • Author(s): Curtis C. Hovey
  • Date: 2015-09-29 19:43:29 UTC
  • mfrom: (47.1.4 wily-proposed)
  • Revision ID: package-import@ubuntu.com-20150929194329-9y496tbic30hc7vp
Tags: 1.24.6-0ubuntu1~15.04.1
Backport of 1.24.6 from wily. (LP: #1500916, #1497087)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright 2012 The Go Authors. All rights reserved.
2
 
// Use of this source code is governed by a BSD-style
3
 
// license that can be found in the LICENSE file.
4
 
 
5
 
package bn256
6
 
 
7
 
import (
8
 
        "math/big"
9
 
)
10
 
 
11
 
func bigFromBase10(s string) *big.Int {
12
 
        n, _ := new(big.Int).SetString(s, 10)
13
 
        return n
14
 
}
15
 
 
16
 
// u is the BN parameter that determines the prime: 1868033³.
17
 
var u = bigFromBase10("6518589491078791937")
18
 
 
19
 
// p is a prime over which we form a basic field: 36u⁴+36u³+24u³+6u+1.
20
 
var p = bigFromBase10("65000549695646603732796438742359905742825358107623003571877145026864184071783")
21
 
 
22
 
// Order is the number of elements in both G₁ and G₂: 36u⁴+36u³+18u³+6u+1.
23
 
var Order = bigFromBase10("65000549695646603732796438742359905742570406053903786389881062969044166799969")
24
 
 
25
 
// xiToPMinus1Over6 is ξ^((p-1)/6) where ξ = i+3.
26
 
var xiToPMinus1Over6 = &gfP2{bigFromBase10("8669379979083712429711189836753509758585994370025260553045152614783263110636"), bigFromBase10("19998038925833620163537568958541907098007303196759855091367510456613536016040")}
27
 
 
28
 
// xiToPMinus1Over3 is ξ^((p-1)/3) where ξ = i+3.
29
 
var xiToPMinus1Over3 = &gfP2{bigFromBase10("26098034838977895781559542626833399156321265654106457577426020397262786167059"), bigFromBase10("15931493369629630809226283458085260090334794394361662678240713231519278691715")}
30
 
 
31
 
// xiToPMinus1Over2 is ξ^((p-1)/2) where ξ = i+3.
32
 
var xiToPMinus1Over2 = &gfP2{bigFromBase10("50997318142241922852281555961173165965672272825141804376761836765206060036244"), bigFromBase10("38665955945962842195025998234511023902832543644254935982879660597356748036009")}
33
 
 
34
 
// xiToPSquaredMinus1Over3 is ξ^((p²-1)/3) where ξ = i+3.
35
 
var xiToPSquaredMinus1Over3 = bigFromBase10("65000549695646603727810655408050771481677621702948236658134783353303381437752")
36
 
 
37
 
// xiTo2PSquaredMinus2Over3 is ξ^((2p²-2)/3) where ξ = i+3 (a cubic root of unity, mod p).
38
 
var xiTo2PSquaredMinus2Over3 = bigFromBase10("4985783334309134261147736404674766913742361673560802634030")
39
 
 
40
 
// xiToPSquaredMinus1Over6 is ξ^((1p²-1)/6) where ξ = i+3 (a cubic root of -1, mod p).
41
 
var xiToPSquaredMinus1Over6 = bigFromBase10("65000549695646603727810655408050771481677621702948236658134783353303381437753")
42
 
 
43
 
// xiTo2PMinus2Over3 is ξ^((2p-2)/3) where ξ = i+3.
44
 
var xiTo2PMinus2Over3 = &gfP2{bigFromBase10("19885131339612776214803633203834694332692106372356013117629940868870585019582"), bigFromBase10("21645619881471562101905880913352894726728173167203616652430647841922248593627")}