INNER CODE UNIT · Go

getVector

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

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])
	res[1].Mul(a, &l.V1[1]).Add(&res[1], &tmp)
	return res
}

// getVector4 returns aV1 + bV2 + cV3 + dV4.
func getVector4(l *Lattice4, a, b, c, d *big.Int) [4]big.Int {
	var res [4]big.Int
	coeffs := [4]*big.Int{a, b, c, d}
	var tmp big.Int
	for row := range 4 {
		for col := range 4 {
			tmp.Mul(coeffs[col], &l.V[col][row])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…