/
arith_decl.gotemp
61 lines (49 loc) · 1.47 KB
/
arith_decl.gotemp
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
49
50
51
52
53
54
55
56
57
58
59
60
61
// Code generated by go generate; DO NOT EDIT.
// This file was generated by robots.
//go:build {{if .OPT_ARM}}({{end}}amd64 && !purego{{if .OPT_ARM}}) || (arm64 && !purego){{end}}
// +build amd64,!purego{{if .OPT_ARM}} arm64,!purego{{end}}
package {{.PACKAGE}}
import (
. "github.com/cloudflare/circl/dh/sidh/internal/common"
)
// If choice = 0, leave x unchanged. If choice = 1, sets x to y.
// If choice is neither 0 nor 1 then behaviour is undefined.
// This function executes in constant time.
//
//go:noescape
func cmov{{.FIELD}}(x, y *Fp, choice uint8)
// If choice = 0, leave x,y unchanged. If choice = 1, set x,y = y,x.
// If choice is neither 0 nor 1 then behaviour is undefined.
// This function executes in constant time.
//
//go:noescape
func cswap{{.FIELD}}(x, y *Fp, choice uint8)
// Compute z = x + y (mod p).
//
//go:noescape
func add{{.FIELD}}(z, x, y *Fp)
// Compute z = x - y (mod p).
//
//go:noescape
func sub{{.FIELD}}(z, x, y *Fp)
// Compute z = x + y, without reducing mod p.
//
//go:noescape
func adl{{.FIELD}}(z, x, y *FpX2)
// Compute z = x - y, without reducing mod p.
//
//go:noescape
func sul{{.FIELD}}(z, x, y *FpX2)
// Reduce a field element in [0, 2*p) to one in [0,p).
//
//go:noescape
func mod{{.FIELD}}(x *Fp)
// Computes z = x * y.
//
//go:noescape
func mul{{.FIELD}}(z *FpX2, x, y *Fp)
// Computes the Montgomery reduction z = x R^{-1} (mod 2*p). On return value
// of x may be changed. z=x not allowed.
//
//go:noescape
func rdc{{.FIELD}}(z *Fp, x *FpX2)