@@ -114,7 +114,7 @@ export class CommitteeMember extends Struct({
114
114
let C = new Array < Group > ( this . T ) ;
115
115
for ( let i = 0 ; i < this . T ; i ++ ) {
116
116
a [ i ] = Field . random ( ) ;
117
- C [ i ] = Group . generator . scale ( Scalar . fromFields ( a [ i ] . toFields ( ) ) ) ;
117
+ C [ i ] = Group . generator . scale ( Scalar . fromFields ( [ a [ i ] ] ) ) ;
118
118
}
119
119
let f = new Array < Field > ( this . N ) ;
120
120
for ( let i = 0 ; i < this . N ; i ++ ) {
@@ -130,7 +130,9 @@ export class CommitteeMember extends Struct({
130
130
return new Round1Contribution ( {
131
131
C : secret . C ,
132
132
keyId : keyId ,
133
- witness : new ( getMerkleWitnessType ( this . index - 1 ) ) ( dummyWitness ) ,
133
+ witness : new ( getMerkleWitnessType ( ROUND_1_CONTRIBUTION_DEPTH ) ) (
134
+ dummyWitness
135
+ ) ,
134
136
} ) ;
135
137
}
136
138
@@ -155,7 +157,9 @@ export class CommitteeMember extends Struct({
155
157
}
156
158
return new Round2Contribution ( {
157
159
data : data ,
158
- witness : new ( getMerkleWitnessType ( this . index - 1 ) ) ( dummyWitness ) ,
160
+ witness : new ( getMerkleWitnessType ( ROUND_2_CONTRIBUTION_DEPTH ) ) (
161
+ dummyWitness
162
+ ) ,
159
163
keyId : keyId ,
160
164
} ) ;
161
165
}
@@ -181,7 +185,9 @@ export class CommitteeMember extends Struct({
181
185
}
182
186
return new TallyContribution ( {
183
187
D : D ,
184
- witness : new ( getMerkleWitnessType ( this . index - 1 ) ) ( dummyWitness ) ,
188
+ witness : new ( getMerkleWitnessType ( TALLY_CONTRIBUTION_DEPTH ) ) (
189
+ dummyWitness
190
+ ) ,
185
191
keyId : keyId ,
186
192
} ) ;
187
193
}
@@ -208,4 +214,23 @@ export class CommitteeMember extends Struct({
208
214
}
209
215
return lagrangeCoefficient ;
210
216
}
217
+
218
+ // getResultVector(listIndex: number[], D: Group[], M: Group[]) {
219
+ // let lagrangeCoefficient = this.getLagrangeCoefficient(listIndex);
220
+ // let sumD = Array<Group>(M.length);
221
+ // for (let i = 0; i < sumD.length; i++) {
222
+ // sumD[i] = BabyJub.getZeroPoint();
223
+ // }
224
+ // for (let i = 0; i < threshold; i++) {
225
+ // for (let j = 0; j < sumD.length; j++) {
226
+ // sumD[j] = BabyJub.addPoint(
227
+ // sumD[j],
228
+ // BabyJub.mulPointEscalar(
229
+ // Utils.getBigIntegerArray(D[i][j]),
230
+ // lagrangeCoefficient[i]
231
+ // )
232
+ // );
233
+ // }
234
+ // }
235
+ // }
211
236
}
0 commit comments