INNER CODE UNIT · Go

n

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

	n := 2 * uint(((l.Det.BitLen()+32)>>6)<<6)
	k1.Rsh(&k1, n)
	k2.Rsh(&k2, n)
	v := getVector(l, &k1, &k2)
	v[0].Sub(s, &v[0])
	v[1].Neg(&v[1])
	return v
}

// SplitScalarFour computes k0,k1,k2,k3 such that
// k0+k1*lambda1+k2*lambda2+k3*lambda1*lambda2 = s [r].
// It uses a closest vector approximation in a 4-dimensional lattice.
func SplitScalarFour(s *big.Int, l *Lattice4) [4]big.Int {
	var k1, k2, k3, k4 big.Int
	k1.Mul(s, &l.b1)
	k2.Mul(s, &l.b2)
	k3.Mul(s, &l.b3)
	k4.Mul(s, &l.b4)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…