@@ -267,7 +267,7 @@ static int secp256k1_bppp_rangeproof_norm_product_prove(
267
267
secp256k1_scalar mu_sq , rho_inv , c0_l1 , c1_l0 , x_v , c1_l1 , r_v ;
268
268
secp256k1_gej rj , xj ;
269
269
secp256k1_ge r_ge , x_ge ;
270
- secp256k1_scalar e ;
270
+ secp256k1_scalar gamma ;
271
271
272
272
secp256k1_scalar_inverse_var (& rho_inv , & rho_f );
273
273
secp256k1_scalar_sqr (& mu_sq , & mu_f );
@@ -314,22 +314,22 @@ static int secp256k1_bppp_rangeproof_norm_product_prove(
314
314
secp256k1_bppp_serialize_points (& proof [proof_idx ], & x_ge , & r_ge );
315
315
proof_idx += 65 ;
316
316
317
- /* Obtain challenge e for the the next round */
317
+ /* Obtain challenge gamma for the the next round */
318
318
secp256k1_sha256_write (transcript , & proof [proof_idx - 65 ], 65 );
319
- secp256k1_bppp_challenge_scalar (& e , transcript , 0 );
319
+ secp256k1_bppp_challenge_scalar (& gamma , transcript , 0 );
320
320
321
321
if (g_len > 1 ) {
322
322
for (i = 0 ; i < g_len ; i = i + 2 ) {
323
323
secp256k1_scalar nl , nr ;
324
324
secp256k1_gej gl , gr ;
325
325
secp256k1_scalar_mul (& nl , & n_vec [i ], & rho_inv );
326
- secp256k1_scalar_mul (& nr , & n_vec [i + 1 ], & e );
326
+ secp256k1_scalar_mul (& nr , & n_vec [i + 1 ], & gamma );
327
327
secp256k1_scalar_add (& n_vec [i /2 ], & nl , & nr );
328
328
329
329
secp256k1_gej_set_ge (& gl , & g_vec [i ]);
330
330
secp256k1_ecmult (& gl , & gl , & rho_f , NULL );
331
331
secp256k1_gej_set_ge (& gr , & g_vec [i + 1 ]);
332
- secp256k1_ecmult (& gr , & gr , & e , NULL );
332
+ secp256k1_ecmult (& gr , & gr , & gamma , NULL );
333
333
secp256k1_gej_add_var (& gl , & gl , & gr , NULL );
334
334
secp256k1_ge_set_gej_var (& g_vec [i /2 ], & gl );
335
335
}
@@ -339,14 +339,14 @@ static int secp256k1_bppp_rangeproof_norm_product_prove(
339
339
for (i = 0 ; i < h_len ; i = i + 2 ) {
340
340
secp256k1_scalar temp1 ;
341
341
secp256k1_gej grj ;
342
- secp256k1_scalar_mul (& temp1 , & c_vec [i + 1 ], & e );
342
+ secp256k1_scalar_mul (& temp1 , & c_vec [i + 1 ], & gamma );
343
343
secp256k1_scalar_add (& c_vec [i /2 ], & c_vec [i ], & temp1 );
344
344
345
- secp256k1_scalar_mul (& temp1 , & l_vec [i + 1 ], & e );
345
+ secp256k1_scalar_mul (& temp1 , & l_vec [i + 1 ], & gamma );
346
346
secp256k1_scalar_add (& l_vec [i /2 ], & l_vec [i ], & temp1 );
347
347
348
348
secp256k1_gej_set_ge (& grj , & g_vec [G_GENS_LEN + i + 1 ]);
349
- secp256k1_ecmult (& grj , & grj , & e , NULL );
349
+ secp256k1_ecmult (& grj , & grj , & gamma , NULL );
350
350
secp256k1_gej_add_ge_var (& grj , & grj , & g_vec [G_GENS_LEN + i ], NULL );
351
351
secp256k1_ge_set_gej_var (& g_vec [G_GENS_LEN + i /2 ], & grj );
352
352
}
@@ -367,7 +367,7 @@ static int secp256k1_bppp_rangeproof_norm_product_prove(
367
367
typedef struct ec_mult_verify_cb_data1 {
368
368
const unsigned char * proof ;
369
369
const secp256k1_ge * commit ;
370
- const secp256k1_scalar * challenges ;
370
+ const secp256k1_scalar * gammas ;
371
371
} ec_mult_verify_cb_data1 ;
372
372
373
373
static int ec_mult_verify_cb1 (secp256k1_scalar * sc , secp256k1_ge * pt , size_t idx , void * cbdata ) {
@@ -381,7 +381,7 @@ static int ec_mult_verify_cb1(secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx
381
381
if (idx % 2 == 0 ) {
382
382
unsigned char pk_buf [33 ];
383
383
idx /= 2 ;
384
- * sc = data -> challenges [idx ];
384
+ * sc = data -> gammas [idx ];
385
385
pk_buf [0 ] = 2 | (data -> proof [65 * idx ] >> 1 );
386
386
memcpy (& pk_buf [1 ], & data -> proof [65 * idx + 1 ], 32 );
387
387
if (!secp256k1_eckey_pubkey_parse (pt , pk_buf , sizeof (pk_buf ))) {
@@ -393,7 +393,7 @@ static int ec_mult_verify_cb1(secp256k1_scalar *sc, secp256k1_ge *pt, size_t idx
393
393
idx /= 2 ;
394
394
secp256k1_scalar_set_int (& neg_one , 1 );
395
395
secp256k1_scalar_negate (& neg_one , & neg_one );
396
- * sc = data -> challenges [idx ];
396
+ * sc = data -> gammas [idx ];
397
397
secp256k1_scalar_sqr (sc , sc );
398
398
secp256k1_scalar_add (sc , sc , & neg_one );
399
399
pk_buf [0 ] = 2 | data -> proof [65 * idx ];
@@ -440,7 +440,7 @@ static int secp256k1_bppp_rangeproof_norm_product_verify(
440
440
const secp256k1_ge * commit
441
441
) {
442
442
secp256k1_scalar rho_f , mu_f , v , n , l , rho_inv , h_c ;
443
- secp256k1_scalar * es , * s_g , * s_h , * rho_inv_pows ;
443
+ secp256k1_scalar * gammas , * s_g , * s_h , * rho_inv_pows ;
444
444
secp256k1_gej res1 , res2 ;
445
445
size_t i = 0 , scratch_checkpoint ;
446
446
int overflow ;
@@ -469,13 +469,13 @@ static int secp256k1_bppp_rangeproof_norm_product_verify(
469
469
if (overflow ) return 0 ;
470
470
if (secp256k1_scalar_is_zero (rho )) return 0 ;
471
471
472
- /* Collect the challenges in a new vector */
472
+ /* Collect the gammas in a new vector */
473
473
scratch_checkpoint = secp256k1_scratch_checkpoint (& ctx -> error_callback , scratch );
474
- es = (secp256k1_scalar * )secp256k1_scratch_alloc (& ctx -> error_callback , scratch , n_rounds * sizeof (secp256k1_scalar ));
474
+ gammas = (secp256k1_scalar * )secp256k1_scratch_alloc (& ctx -> error_callback , scratch , n_rounds * sizeof (secp256k1_scalar ));
475
475
s_g = (secp256k1_scalar * )secp256k1_scratch_alloc (& ctx -> error_callback , scratch , g_len * sizeof (secp256k1_scalar ));
476
476
s_h = (secp256k1_scalar * )secp256k1_scratch_alloc (& ctx -> error_callback , scratch , h_len * sizeof (secp256k1_scalar ));
477
477
rho_inv_pows = (secp256k1_scalar * )secp256k1_scratch_alloc (& ctx -> error_callback , scratch , log_g_len * sizeof (secp256k1_scalar ));
478
- if (es == NULL || s_g == NULL || s_h == NULL || rho_inv_pows == NULL ) {
478
+ if (gammas == NULL || s_g == NULL || s_h == NULL || rho_inv_pows == NULL ) {
479
479
secp256k1_scratch_apply_checkpoint (& ctx -> error_callback , scratch , scratch_checkpoint );
480
480
return 0 ;
481
481
}
@@ -491,10 +491,10 @@ static int secp256k1_bppp_rangeproof_norm_product_verify(
491
491
}
492
492
493
493
for (i = 0 ; i < n_rounds ; i ++ ) {
494
- secp256k1_scalar e ;
494
+ secp256k1_scalar gamma ;
495
495
secp256k1_sha256_write (transcript , & proof [i * 65 ], 65 );
496
- secp256k1_bppp_challenge_scalar (& e , transcript , 0 );
497
- es [i ] = e ;
496
+ secp256k1_bppp_challenge_scalar (& gamma , transcript , 0 );
497
+ gammas [i ] = gamma ;
498
498
}
499
499
/* s_g[0] = n * \prod_{j=0}^{log_g_len - 1} rho^(2^j)
500
500
* = n * rho^(2^log_g_len - 1)
@@ -504,19 +504,19 @@ static int secp256k1_bppp_rangeproof_norm_product_verify(
504
504
for (i = 1 ; i < g_len ; i ++ ) {
505
505
size_t log_i = secp256k1_bppp_log2 (i );
506
506
size_t nearest_pow_of_two = (size_t )1 << log_i ;
507
- /* This combines the two multiplications of challenges and rho_invs in a
507
+ /* This combines the two multiplications of gammas and rho_invs in a
508
508
* single loop.
509
509
* s_g[i] = s_g[i - nearest_pow_of_two]
510
510
* * e[log_i] * rho_inv^(2^log_i) */
511
- secp256k1_scalar_mul (& s_g [i ], & s_g [i - nearest_pow_of_two ], & es [log_i ]);
511
+ secp256k1_scalar_mul (& s_g [i ], & s_g [i - nearest_pow_of_two ], & gammas [log_i ]);
512
512
secp256k1_scalar_mul (& s_g [i ], & s_g [i ], & rho_inv_pows [log_i ]);
513
513
}
514
514
s_h [0 ] = l ;
515
515
secp256k1_scalar_set_int (& h_c , 0 );
516
516
for (i = 1 ; i < h_len ; i ++ ) {
517
517
size_t log_i = secp256k1_bppp_log2 (i );
518
518
size_t nearest_pow_of_two = (size_t )1 << log_i ;
519
- secp256k1_scalar_mul (& s_h [i ], & s_h [i - nearest_pow_of_two ], & es [log_i ]);
519
+ secp256k1_scalar_mul (& s_h [i ], & s_h [i - nearest_pow_of_two ], & gammas [log_i ]);
520
520
}
521
521
secp256k1_scalar_inner_product (& h_c , c_vec , 0 /* a_offset */ , s_h , 0 /* b_offset */ , 1 /* step */ , h_len );
522
522
/* Compute v = n*n*mu_f + l*h_c where mu_f = rho_f^2 */
@@ -529,7 +529,7 @@ static int secp256k1_bppp_rangeproof_norm_product_verify(
529
529
ec_mult_verify_cb_data1 data ;
530
530
data .proof = proof ;
531
531
data .commit = commit ;
532
- data .challenges = es ;
532
+ data .gammas = gammas ;
533
533
534
534
if (!secp256k1_ecmult_multi_var (& ctx -> error_callback , scratch , & res1 , NULL , ec_mult_verify_cb1 , & data , 2 * n_rounds + 1 )) {
535
535
secp256k1_scratch_apply_checkpoint (& ctx -> error_callback , scratch , scratch_checkpoint );
0 commit comments