@@ -15,7 +15,6 @@ type PrecomputeLagrange struct {
15
15
}
16
16
17
17
func (pcl PrecomputeLagrange ) Equal (other PrecomputeLagrange ) bool {
18
-
19
18
if pcl .num_points != other .num_points {
20
19
return false
21
20
}
@@ -34,15 +33,12 @@ func (pcl PrecomputeLagrange) Equal(other PrecomputeLagrange) bool {
34
33
}
35
34
36
35
func NewPrecomputeLagrange (points []Element ) * PrecomputeLagrange {
37
-
38
36
table := make ([]* LagrangeTablePoints , len (points ))
39
37
parallel .Execute (len (points ), func (start , end int ) {
40
-
41
38
for i := start ; i < end ; i ++ {
42
39
point := points [i ]
43
40
table [i ] = newLagrangeTablePoints (point )
44
41
}
45
-
46
42
})
47
43
48
44
return & PrecomputeLagrange {
@@ -52,7 +48,6 @@ func NewPrecomputeLagrange(points []Element) *PrecomputeLagrange {
52
48
}
53
49
54
50
func (pcl * PrecomputeLagrange ) SerializePrecomputedLagrange (w io.Writer ) error {
55
-
56
51
err := binary .Write (w , binary .LittleEndian , int64 (pcl .num_points ))
57
52
if err != nil {
58
53
return err
@@ -98,15 +93,14 @@ func DeserializePrecomputedLagrange(reader io.Reader) (*PrecomputeLagrange, erro
98
93
// Deserialize the matrix
99
94
pcl .inner [i ].matrix = make ([]bandersnatch.PointAffine , rowLen )
100
95
for j := int64 (0 ); j < rowLen ; j ++ {
101
-
102
96
pcl .inner [i ].matrix [j ] = bandersnatch .ReadUncompressedPoint (reader )
103
97
}
104
98
}
105
99
106
100
return & pcl , nil
107
101
}
108
102
109
- func (p * PrecomputeLagrange ) Commit (evaluations []fr.Element ) * Element {
103
+ func (p * PrecomputeLagrange ) Commit (evaluations []fr.Element ) Element {
110
104
var result Element
111
105
result .Identity ()
112
106
@@ -124,11 +118,11 @@ func (p *PrecomputeLagrange) Commit(evaluations []fr.Element) *Element {
124
118
if byte == 0 {
125
119
continue
126
120
}
127
- var tp = table .point (row , byte )
121
+ tp : = table .point (row , byte )
128
122
result .AddMixed (& result , * tp )
129
123
}
130
124
}
131
- return & result
125
+ return result
132
126
}
133
127
134
128
type LagrangeTablePoints struct {
@@ -166,7 +160,7 @@ func newLagrangeTablePoints(point Element) *LagrangeTablePoints {
166
160
var rows []Element
167
161
rows = append (rows , base_row ... )
168
162
169
- var scale = base
163
+ scale : = base
170
164
// TODO: we can do this in parallel
171
165
for i := 1 ; i < num_rows ; i ++ {
172
166
@@ -191,7 +185,6 @@ func (ltp *LagrangeTablePoints) point(index int, value uint8) *bandersnatch.Poin
191
185
}
192
186
193
187
func compute_base_row (point Element , num_points int ) []Element {
194
-
195
188
row := make ([]Element , num_points )
196
189
row [0 ] = point
197
190
0 commit comments