-
Notifications
You must be signed in to change notification settings - Fork 0
/
field_amd64.go
48 lines (34 loc) · 1.04 KB
/
field_amd64.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//go:build !curve1174_purego
package curve1174
import "github.com/klauspost/cpuid"
var cpuSupported = cpuid.CPU.BMI2() && cpuid.CPU.ADX()
// res=x * y % 2^251-9
//go:noescape
func mul(res *FieldElement, x *FieldElement, y *FieldElement)
// res=x * y % 2^251-9
//go:noescape
func mulNoAdx(res *FieldElement, x *FieldElement, y *FieldElement)
// res=x % 2^251-9
//go:noescape
func mod(res *FieldElement, x *FieldElement)
//go:noescape
func sqr(res *FieldElement, x *FieldElement)
// res=x * 2 % 2^251-9
//go:noescape
func mul2(res *FieldElement, x *FieldElement)
// res=x >> 1
//go:noescape
func div2(res *FieldElement, x *FieldElement)
// res=x - y % 2^251-9
//go:noescape
func sub(res *FieldElement, x *FieldElement, y *FieldElement)
// res=x + y % 2^251-9
//go:noescape
func add(res *FieldElement, x *FieldElement, y *FieldElement)
// res=x * -1174 % 2^251-9
//go:noescape
func mulD(res *FieldElement, x *FieldElement)
//go:noescape
func selectPoint(res *Point, table *[16]Point, index uint64)
//go:noescape
func fastInverse(res, x *FieldElement)