@@ -176,19 +176,19 @@ static int secp256k1_frost_pubkey_combine_callback(secp256k1_scalar *sc, secp256
176
176
return secp256k1_pubkey_load (ctx -> ctx , pt , & ctx -> pks [idx ][0 ]);
177
177
}
178
178
179
- static int vss_verify (const secp256k1_context * ctx , uint16_t threshold , uint16_t index , const secp256k1_scalar * share , const secp256k1_pubkey * const * vss_commitment ) {
179
+ static int vss_verify (const secp256k1_context * ctx , uint16_t threshold , uint16_t idx , const secp256k1_scalar * share , const secp256k1_pubkey * const * vss_commitment ) {
180
180
secp256k1_scalar share_neg ;
181
181
secp256k1_gej tmpj ;
182
182
secp256k1_frost_verify_share_ecmult_data verify_share_ecmult_data ;
183
183
184
184
/* Use an EC multi-multiplication to verify the following equation:
185
- * 0 = - share_i*G + index ^0*vss_commitment[0]
185
+ * 0 = - share_i*G + idx ^0*vss_commitment[0]
186
186
* + ...
187
- * + index ^(threshold - 1)*vss_commitment[threshold - 1]*/
187
+ * + idx ^(threshold - 1)*vss_commitment[threshold - 1]*/
188
188
verify_share_ecmult_data .ctx = ctx ;
189
189
verify_share_ecmult_data .pubcoeff = vss_commitment ;
190
- /* Evaluate the public polynomial at the index */
191
- secp256k1_scalar_set_int (& verify_share_ecmult_data .idx , index );
190
+ /* Evaluate the public polynomial at the idx */
191
+ secp256k1_scalar_set_int (& verify_share_ecmult_data .idx , idx );
192
192
secp256k1_scalar_set_int (& verify_share_ecmult_data .idxn , 1 );
193
193
secp256k1_scalar_negate (& share_neg , share );
194
194
/* TODO: add scratch */
@@ -198,7 +198,7 @@ static int vss_verify(const secp256k1_context* ctx, uint16_t threshold, uint16_t
198
198
return secp256k1_gej_is_infinity (& tmpj );
199
199
}
200
200
201
- int secp256k1_frost_share_agg (const secp256k1_context * ctx , secp256k1_frost_share * agg_share , secp256k1_xonly_pubkey * agg_pk , unsigned char * vss_hash , const secp256k1_frost_share * const * shares , const secp256k1_pubkey * const * pubcoeffs , uint16_t n_shares , uint16_t threshold , uint16_t index ) {
201
+ int secp256k1_frost_share_agg (const secp256k1_context * ctx , secp256k1_frost_share * agg_share , secp256k1_xonly_pubkey * agg_pk , unsigned char * vss_hash , const secp256k1_frost_share * const * shares , const secp256k1_pubkey * const * pubcoeffs , uint16_t n_shares , uint16_t threshold , uint16_t idx ) {
202
202
secp256k1_frost_pubkey_combine_ecmult_data pubkey_combine_ecmult_data ;
203
203
secp256k1_gej pkj ;
204
204
secp256k1_ge pkp ;
@@ -214,7 +214,7 @@ int secp256k1_frost_share_agg(const secp256k1_context* ctx, secp256k1_frost_shar
214
214
ARG_CHECK (shares != NULL );
215
215
ARG_CHECK (pubcoeffs != NULL );
216
216
ARG_CHECK (n_shares > 0 );
217
- ARG_CHECK (index > 0 );
217
+ ARG_CHECK (idx > 0 );
218
218
219
219
if (threshold == 0 || threshold > n_shares ) {
220
220
return 0 ;
@@ -228,7 +228,7 @@ int secp256k1_frost_share_agg(const secp256k1_context* ctx, secp256k1_frost_shar
228
228
if (overflow ) {
229
229
return 0 ;
230
230
}
231
- if (!vss_verify (ctx , threshold , index , & share_i , & pubcoeffs [i ])) {
231
+ if (!vss_verify (ctx , threshold , idx , & share_i , & pubcoeffs [i ])) {
232
232
return 0 ;
233
233
}
234
234
secp256k1_scalar_add (& acc , & acc , & share_i );
0 commit comments