@@ -15,7 +15,6 @@ type PrecomputeLagrange struct {
1515}
1616
1717func  (pcl  PrecomputeLagrange ) Equal (other  PrecomputeLagrange ) bool  {
18- 
1918	if  pcl .num_points  !=  other .num_points  {
2019		return  false 
2120	}
@@ -34,15 +33,12 @@ func (pcl PrecomputeLagrange) Equal(other PrecomputeLagrange) bool {
3433}
3534
3635func  NewPrecomputeLagrange (points  []Element ) * PrecomputeLagrange  {
37- 
3836	table  :=  make ([]* LagrangeTablePoints , len (points ))
3937	parallel .Execute (len (points ), func (start , end  int ) {
40- 
4138		for  i  :=  start ; i  <  end ; i ++  {
4239			point  :=  points [i ]
4340			table [i ] =  newLagrangeTablePoints (point )
4441		}
45- 
4642	})
4743
4844	return  & PrecomputeLagrange {
@@ -52,7 +48,6 @@ func NewPrecomputeLagrange(points []Element) *PrecomputeLagrange {
5248}
5349
5450func  (pcl  * PrecomputeLagrange ) SerializePrecomputedLagrange (w  io.Writer ) error  {
55- 
5651	err  :=  binary .Write (w , binary .LittleEndian , int64 (pcl .num_points ))
5752	if  err  !=  nil  {
5853		return  err 
@@ -98,15 +93,14 @@ func DeserializePrecomputedLagrange(reader io.Reader) (*PrecomputeLagrange, erro
9893		// Deserialize the matrix 
9994		pcl .inner [i ].matrix  =  make ([]bandersnatch.PointAffine , rowLen )
10095		for  j  :=  int64 (0 ); j  <  rowLen ; j ++  {
101- 
10296			pcl .inner [i ].matrix [j ] =  bandersnatch .ReadUncompressedPoint (reader )
10397		}
10498	}
10599
106100	return  & pcl , nil 
107101}
108102
109- func  (p  * PrecomputeLagrange ) Commit (evaluations  []fr.Element ) * Element  {
103+ func  (p  * PrecomputeLagrange ) Commit (evaluations  []fr.Element ) Element  {
110104	var  result  Element 
111105	result .Identity ()
112106
@@ -124,11 +118,11 @@ func (p *PrecomputeLagrange) Commit(evaluations []fr.Element) *Element {
124118			if  byte  ==  0  {
125119				continue 
126120			}
127- 			var   tp  =  table .point (row , byte )
121+ 			tp  : =  table .point (row , byte )
128122			result .AddMixed (& result , * tp )
129123		}
130124	}
131- 	return  & result 
125+ 	return  result 
132126}
133127
134128type  LagrangeTablePoints  struct  {
@@ -166,7 +160,7 @@ func newLagrangeTablePoints(point Element) *LagrangeTablePoints {
166160	var  rows  []Element 
167161	rows  =  append (rows , base_row ... )
168162
169- 	var   scale  =  base 
163+ 	scale  : =  base 
170164	// TODO: we can do this in parallel 
171165	for  i  :=  1 ; i  <  num_rows ; i ++  {
172166
@@ -191,7 +185,6 @@ func (ltp *LagrangeTablePoints) point(index int, value uint8) *bandersnatch.Poin
191185}
192186
193187func  compute_base_row (point  Element , num_points  int ) []Element  {
194- 
195188	row  :=  make ([]Element , num_points )
196189	row [0 ] =  point 
197190
0 commit comments