INNER CODE UNIT · Go

roundingSigned

Consensys/gnark-crypto · ecc/utils.go:297

func roundingSigned(n, d, res *big.Int) {
	if n.Sign() >= 0 {
		rounding(n, d, res)
		return
	}
	var nn big.Int
	nn.Neg(n)
	rounding(&nn, d, res)
	res.Neg(res)
}

// getVector returns aV1 + bV2
func getVector(l *Lattice, a, b *big.Int) [2]big.Int {
	var res [2]big.Int
	var tmp big.Int
	tmp.Mul(b, &l.V2[0])
	res[0].Mul(a, &l.V1[0]).Add(&res[0], &tmp)
	tmp.Mul(b, &l.V2[1])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…