File: field_amd64.go

package info (click to toggle)
golang-github-bwesterb-go-ristretto 1.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 628 kB
  • sloc: ansic: 1,915; asm: 278; makefile: 3
file content (28 lines) | stat: -rw-r--r-- 613 bytes parent folder | download
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
//go:build amd64 && !go1.13 && !forcegeneric
// +build amd64,!go1.13,!forcegeneric

package edwards25519

//go:noescape
func feMul(out, a, b *FieldElement)

//go:noescape
func feSquare(out, a *FieldElement)

// Sets fe to a * b.  Returns fe.
func (fe *FieldElement) Mul(a, b *FieldElement) *FieldElement {
	feMul(fe, a, b)
	return fe
}

// Sets fe to a^2.  Returns fe.
func (fe *FieldElement) Square(a *FieldElement) *FieldElement {
	feSquare(fe, a)
	return fe
}

// Sets fe to 2 * a^2.  Returns fe.
func (fe *FieldElement) DoubledSquare(a *FieldElement) *FieldElement {
	feSquare(fe, a)
	return fe.add(fe, fe)
}