@@ -189,7 +189,7 @@ where
189
189
}
190
190
191
191
debug_assert_eq ! ( Self :: commit( pp, poly) . unwrap( ) . 0 , comm. 0 ) ;
192
- debug_assert_eq ! ( poly. evaluate_BE ( point) , eval. 0 ) ;
192
+ debug_assert_eq ! ( poly. evaluate ( point) , eval. 0 ) ;
193
193
194
194
let ( quotients, remainder) = quotients ( poly, point) ;
195
195
debug_assert_eq ! ( remainder, eval. 0 ) ;
@@ -329,7 +329,7 @@ fn quotients<F: PrimeField>(poly: &MultilinearPolynomial<F>, point: &[F]) -> (Ve
329
329
330
330
let mut remainder = poly. Z . to_vec ( ) ;
331
331
let mut quotients = point
332
- . iter ( )
332
+ . iter ( ) . rev ( ) // assume polynomial variables come in LE form
333
333
. enumerate ( )
334
334
. rev ( )
335
335
. map ( |( num_var, x_i) | {
@@ -361,8 +361,8 @@ fn quotients<F: PrimeField>(poly: &MultilinearPolynomial<F>, point: &[F]) -> (Ve
361
361
}
362
362
363
363
// TODO : move this somewhere else
364
- fn eval_and_quotient_scalars < F : Field > ( y : F , x : F , z : F , u : & [ F ] ) -> ( F , Vec < F > ) {
365
- let num_vars = u . len ( ) ;
364
+ fn eval_and_quotient_scalars < F : Field > ( y : F , x : F , z : F , point : & [ F ] ) -> ( F , Vec < F > ) {
365
+ let num_vars = point . len ( ) ;
366
366
367
367
let squares_of_x = iter:: successors ( Some ( x) , |& x| Some ( x. square ( ) ) )
368
368
. take ( num_vars + 1 )
@@ -397,7 +397,7 @@ fn eval_and_quotient_scalars<F: Field>(y: F, x: F, z: F, u: &[F]) -> (F, Vec<F>)
397
397
. zip ( squares_of_x)
398
398
. zip ( & vs)
399
399
. zip ( & vs[ 1 ..] )
400
- . zip ( u )
400
+ . zip ( point . iter ( ) . rev ( ) ) // assume variables come in LE form
401
401
. map (
402
402
|( ( ( ( ( power_of_y, offset_of_x) , square_of_x) , v_i) , v_j) , u_i) | {
403
403
-( power_of_y * offset_of_x + z * ( square_of_x * v_j - * u_i * v_i) )
@@ -437,15 +437,12 @@ where
437
437
// TODO: the following two lines will need to change base
438
438
let polynomial = MultilinearPolynomial :: new ( poly. to_vec ( ) ) ;
439
439
440
- // Nova evaluates in lower endian, the implementation assumes big endian
441
- let rev_point = point. iter ( ) . rev ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ;
442
-
443
440
let evaluation = ZMEvaluation ( * eval) ;
444
441
ZMPCS :: open (
445
442
pk,
446
443
& commitment,
447
444
& polynomial,
448
- & rev_point ,
445
+ point ,
449
446
& evaluation,
450
447
transcript,
451
448
)
@@ -462,15 +459,12 @@ where
462
459
let commitment = ZMCommitment :: from ( UVKZGCommitment :: from ( * comm) ) ;
463
460
let evaluation = ZMEvaluation ( * eval) ;
464
461
465
- // Nova evaluates in lower endian, the implementation assumes big endian
466
- let rev_point = point. iter ( ) . rev ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ;
467
-
468
462
// TODO: this clone is unsightly!
469
463
ZMPCS :: verify (
470
464
vk,
471
465
transcript,
472
466
& commitment,
473
- & rev_point ,
467
+ point ,
474
468
& evaluation,
475
469
arg. clone ( ) ,
476
470
) ?;
@@ -527,7 +521,7 @@ mod test {
527
521
let point = iter:: from_fn ( || transcript. squeeze ( b"pt" ) . ok ( ) )
528
522
. take ( num_vars)
529
523
. collect :: < Vec < _ > > ( ) ;
530
- let eval = ZMEvaluation ( poly. evaluate_BE ( & point) ) ;
524
+ let eval = ZMEvaluation ( poly. evaluate ( & point) ) ;
531
525
532
526
let mut transcript_prover = Keccak256Transcript :: < E :: G1 > :: new ( b"test" ) ;
533
527
let proof = ZMPCS :: open ( & pp, & comm, & poly, & point, & eval, & mut transcript_prover) . unwrap ( ) ;
@@ -577,11 +571,11 @@ mod test {
577
571
}
578
572
let ( _quotients, remainder) = quotients ( & poly, & point) ;
579
573
assert_eq ! (
580
- poly. evaluate_BE ( & point) ,
574
+ poly. evaluate ( & point) ,
581
575
remainder,
582
576
"point: {:?}, \n eval: {:?}, remainder:{:?}" ,
583
577
point,
584
- poly. evaluate_BE ( & point) ,
578
+ poly. evaluate ( & point) ,
585
579
remainder
586
580
) ;
587
581
}
0 commit comments