Files
xgcl/sm/sm9/internal/bn256/gfp_decl.go
T
2026-05-27 23:03:00 +08:00

25 lines
597 B
Go

//go:build (amd64 && !generic) || (arm64 && !generic)
// +build amd64,!generic arm64,!generic
package bn256
// This file contains forward declarations for the architecture-specific
// assembly implementations of these functions, provided that they exist.
import "golang.org/x/sys/cpu"
var hasBMI2 = cpu.X86.HasBMI2
var _ = hasBMI2
//go:noescape
func gfpNeg(c, a *gfP) // for all a < R, return c = -a mod p, a could be > p
//go:noescape
func gfpAdd(c, a, b *gfP) // for a,b <p
//go:noescape
func gfpSub(c, a, b *gfP) // for a, b < p
//go:noescape
func gfpMul(c, a, b *gfP) // for a*b < pR