@@ -219,7 +219,7 @@ where
219
219
let y = transcript. squeeze ( b"y" ) ?;
220
220
221
221
// Compute the batched, lifted-degree quotient `\hat{q}`
222
- // q_hat = \sum_ {i=0}^{num_vars-1} y^i * X^{2^{ num_vars} - d_k - 1} * q_i(x)
222
+ // qq_hat = ∑_ {i=0}^{num_vars-1} y^i * X^(2^ num_vars - d_k - 1) * q_i(x)
223
223
let q_hat = batched_lifted_degree_quotient ( y, & quotients_polys) ;
224
224
// Compute and absorb the commitment C_q = [\hat{q}]
225
225
let q_hat_comm = UVKZGPCS :: commit ( & pp. commit_pp , & q_hat) ?;
@@ -232,7 +232,7 @@ where
232
232
// Compute batched degree and ZM-identity quotient polynomial pi
233
233
let ( eval_scalar, ( degree_check_q_scalars, zmpoly_q_scalars) ) =
234
234
eval_and_quotient_scalars ( y, x, z, point) ;
235
- // f = z * poly.Z + q\_hat + (-z * Φ_n(x) * e) + \sum_k (q\_scalars_k * q_k)
235
+ // f = z * poly.Z + q_hat + (-z * Φ_n(x) * e) + ∑_k (q_scalars_k * q_k)
236
236
let mut f = UVKZGPoly :: new ( poly. Z . clone ( ) ) ;
237
237
f *= & z;
238
238
f += & q_hat;
@@ -418,7 +418,7 @@ fn eval_and_quotient_scalars<F: Field>(y: F, x: F, z: F, point: &[F]) -> (F, (Ve
418
418
let squares_of_x = iter:: successors ( Some ( x) , |& x| Some ( x. square ( ) ) )
419
419
. take ( num_vars + 1 )
420
420
. collect :: < Vec < _ > > ( ) ;
421
- // offsets_of_x = [Π_{j=i}^{num_vars-1} x^{ 2^j} , i \in 0..= num_vars-1] = [x^{ 2^num_vars - d_i - 1} , i \in 0..= num_vars-1]
421
+ // offsets_of_x = [Π_{j=i}^{num_vars-1} x^( 2^j) , i ∈ [0, num_vars-1]] = [x^( 2^num_vars - d_i - 1) , i ∈ [0, num_vars-1] ]
422
422
let offsets_of_x = {
423
423
let mut offsets_of_x = squares_of_x
424
424
. iter ( )
@@ -433,9 +433,9 @@ fn eval_and_quotient_scalars<F: Field>(y: F, x: F, z: F, point: &[F]) -> (F, (Ve
433
433
offsets_of_x
434
434
} ;
435
435
436
- // vs = [ \frac{ (x^{2^{ num_vars}} - 1)}{x^{ 2^i} - 1} , i \in 0..= num_vars-1]
437
- // Note Φ_{ n-i} (x^{ 2^i}) = \frac{ (x^{ 2^i})^{2^{ n-i|} - 1}{x^{ 2^i} - 1} = \frac{ (x^{2^{ num_vars}} - 1)}{x^{ 2^i} - 1} = vs[i]
438
- // Φ_{ n-i-1} (x^{2^{ i+1}}) = \frac{ (x^{2^{ i+1}})^{2^{ n-i-1}} - 1}{x^{2^{ i+1}} - 1} = \frac{ (x^{2^{ num_vars}} - 1)}{x^{2^{ i+1}} - 1} = vs[i+1]
436
+ // vs = [ (x^(2^ num_vars) - 1) / (x^( 2^i) - 1) , i ∈ [0, num_vars-1] ]
437
+ // Note Φ_( n-i) (x^( 2^i)) = (x^( 2^i))^(2^( n-i) - 1) / (x^( 2^i) - 1) = (x^(2^ num_vars) - 1) / (x^( 2^i) - 1) = vs[i]
438
+ // Φ_( n-i-1) (x^(2^( i+1))) = (x^(2^( i+1)))^(2^( n-i-1)) - 1 / (x^(2^( i+1)) - 1) = (x^(2^ num_vars) - 1) / (x^(2^( i+1)) - 1) = vs[i+1]
439
439
let vs = {
440
440
let v_numer = squares_of_x[ num_vars] - F :: ONE ;
441
441
let mut v_denoms = squares_of_x
@@ -449,8 +449,8 @@ fn eval_and_quotient_scalars<F: Field>(y: F, x: F, z: F, point: &[F]) -> (F, (Ve
449
449
. collect :: < Vec < _ > > ( )
450
450
} ;
451
451
452
- // q_scalars = [- (y^i * x^{ 2^num_vars - d_i - 1} + z * (x^{ 2^i} * vs_{ i+1} - u_i * vs_i )), i = 0..= num_vars-1]
453
- // = [- (y^i * x^{ 2^num_vars - d_i - 1} + z * (x^{ 2^i} * Φ_{ n-i-1} (x^{2^{ i+1}}) - u_i * Φ_{ n-i} (x^{ 2^i} ))), i = 0..= num_vars-1]
452
+ // q_scalars = [- (y^i * x^( 2^num_vars - d_i - 1) + z * (x^( 2^i) * vs[ i+1] - u_i * vs[i] )), i ∈ [0, num_vars-1] ]
453
+ // = [- (y^i * x^( 2^num_vars - d_i - 1) + z * (x^( 2^i) * Φ_( n-i-1) (x^(2^( i+1))) - u_i * Φ_( n-i) (x^( 2^i)))) , i ∈ [0, num_vars-1] ]
454
454
let q_scalars = iter:: successors ( Some ( F :: ONE ) , |acc| Some ( * acc * y) )
455
455
. zip ( offsets_of_x)
456
456
. zip ( squares_of_x)
@@ -464,7 +464,7 @@ fn eval_and_quotient_scalars<F: Field>(y: F, x: F, z: F, point: &[F]) -> (F, (Ve
464
464
)
465
465
. unzip ( ) ;
466
466
467
- // -vs[0] * z = -z \frac{x^{2^{num\_vars}} - 1}{ x - 1} = -z Φ_n(x)
467
+ // -vs[0] * z = -z * (x^(2^num_vars) - 1) / ( x - 1) = -z Φ_n(x)
468
468
( -vs[ 0 ] * z, q_scalars)
469
469
}
470
470
@@ -514,7 +514,9 @@ where
514
514
let commitment = ZMCommitment :: from ( UVKZGCommitment :: from ( * comm) ) ;
515
515
let evaluation = ZMEvaluation ( * eval) ;
516
516
517
- ZMPCS :: verify ( vk, transcript, & commitment, point, & evaluation, arg) ?;
517
+ if !ZMPCS :: verify ( vk, transcript, & commitment, point, & evaluation, arg) ? {
518
+ return Err ( NovaError :: UnSat ) ;
519
+ }
518
520
Ok ( ( ) )
519
521
}
520
522
}
@@ -730,11 +732,11 @@ mod test {
730
732
let u_challenge: Vec < _ > = ( 0 ..num_vars) . map ( |_| Scalar :: random ( & mut rng) ) . collect ( ) ;
731
733
let z_challenge = Scalar :: random ( & mut rng) ;
732
734
733
- // Construct zeta_x using the function
735
+ // Construct ζ_x using the function
734
736
let ( _eval_scalar, ( zeta_x_scalars, _right_quo_scalars) ) =
735
737
eval_and_quotient_scalars ( y_challenge, x_challenge, z_challenge, & u_challenge) ;
736
738
737
- // Now construct zeta_x explicitly
739
+ // Now construct ζ_x explicitly
738
740
let n: u64 = 1 << num_vars;
739
741
// q_batched - \sum_k q_k * y^k * x^{N - deg(q_k) - 1}
740
742
assert_eq ! ( zeta_x_scalars[ 0 ] , -x_challenge. pow( [ n - 1 ] ) ) ;
0 commit comments