INNER CODE UNIT · Go

n

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

	n := 2 * uint(((res.Det.BitLen()+32)>>6)<<6)
	res.b1.Lsh(&res.V2[1], n)
	rounding(&res.b1, &res.Det, &res.b1)
	res.b2.Lsh(&res.V1[1], n)
	rounding(&res.b2, &res.Det, &res.b2)
}

// PrecomputeLattice4 sets res.Det and the rounding constants (b1..b4)
// for a 4-dimensional lattice basis stored in res.V.
// The constants correspond to the first column of adj(res.V)/det(res.V),
// used for the closest vector approximation to (s,0,0,0).
func PrecomputeLattice4(res *Lattice4) {
	var cof [4]big.Int
	// cofactors for row 0
	cof[0] = det3(
		&res.V[1][1], &res.V[2][1], &res.V[3][1],
		&res.V[1][2], &res.V[2][2], &res.V[3][2],
		&res.V[1][3], &res.V[2][3], &res.V[3][3],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…