@@ -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,9 +329,8 @@ 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 ( ) // assume polynomial variables come in LE form
333
333
. enumerate ( )
334
- . rev ( )
335
334
. map ( |( num_var, x_i) | {
336
335
let ( remainder_lo, remainder_hi) = remainder. split_at_mut ( 1 << num_var) ;
337
336
let mut quotient = vec ! [ F :: ZERO ; remainder_lo. len( ) ] ;
@@ -361,8 +360,8 @@ fn quotients<F: PrimeField>(poly: &MultilinearPolynomial<F>, point: &[F]) -> (Ve
361
360
}
362
361
363
362
// 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 ( ) ;
363
+ fn eval_and_quotient_scalars < F : Field > ( y : F , x : F , z : F , point : & [ F ] ) -> ( F , Vec < F > ) {
364
+ let num_vars = point . len ( ) ;
366
365
367
366
let squares_of_x = iter:: successors ( Some ( x) , |& x| Some ( x. square ( ) ) )
368
367
. take ( num_vars + 1 )
@@ -397,7 +396,7 @@ fn eval_and_quotient_scalars<F: Field>(y: F, x: F, z: F, u: &[F]) -> (F, Vec<F>)
397
396
. zip ( squares_of_x)
398
397
. zip ( & vs)
399
398
. zip ( & vs[ 1 ..] )
400
- . zip ( u )
399
+ . zip ( point . iter ( ) . rev ( ) ) // assume variables come in LE form
401
400
. map (
402
401
|( ( ( ( ( power_of_y, offset_of_x) , square_of_x) , v_i) , v_j) , u_i) | {
403
402
-( power_of_y * offset_of_x + z * ( square_of_x * v_j - * u_i * v_i) )
@@ -437,18 +436,8 @@ where
437
436
// TODO: the following two lines will need to change base
438
437
let polynomial = MultilinearPolynomial :: new ( poly. to_vec ( ) ) ;
439
438
440
- // Nova evaluates in lower endian, the implementation assumes big endian
441
- let rev_point = point. iter ( ) . rev ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ;
442
-
443
439
let evaluation = ZMEvaluation ( * eval) ;
444
- ZMPCS :: open (
445
- pk,
446
- & commitment,
447
- & polynomial,
448
- & rev_point,
449
- & evaluation,
450
- transcript,
451
- )
440
+ ZMPCS :: open ( pk, & commitment, & polynomial, point, & evaluation, transcript)
452
441
}
453
442
454
443
fn verify (
@@ -462,18 +451,8 @@ where
462
451
let commitment = ZMCommitment :: from ( UVKZGCommitment :: from ( * comm) ) ;
463
452
let evaluation = ZMEvaluation ( * eval) ;
464
453
465
- // Nova evaluates in lower endian, the implementation assumes big endian
466
- let rev_point = point. iter ( ) . rev ( ) . cloned ( ) . collect :: < Vec < _ > > ( ) ;
467
-
468
454
// TODO: this clone is unsightly!
469
- ZMPCS :: verify (
470
- vk,
471
- transcript,
472
- & commitment,
473
- & rev_point,
474
- & evaluation,
475
- arg. clone ( ) ,
476
- ) ?;
455
+ ZMPCS :: verify ( vk, transcript, & commitment, point, & evaluation, arg. clone ( ) ) ?;
477
456
Ok ( ( ) )
478
457
}
479
458
}
@@ -527,7 +506,7 @@ mod test {
527
506
let point = iter:: from_fn ( || transcript. squeeze ( b"pt" ) . ok ( ) )
528
507
. take ( num_vars)
529
508
. collect :: < Vec < _ > > ( ) ;
530
- let eval = ZMEvaluation ( poly. evaluate_BE ( & point) ) ;
509
+ let eval = ZMEvaluation ( poly. evaluate ( & point) ) ;
531
510
532
511
let mut transcript_prover = Keccak256Transcript :: < E :: G1 > :: new ( b"test" ) ;
533
512
let proof = ZMPCS :: open ( & pp, & comm, & poly, & point, & eval, & mut transcript_prover) . unwrap ( ) ;
@@ -577,11 +556,11 @@ mod test {
577
556
}
578
557
let ( _quotients, remainder) = quotients ( & poly, & point) ;
579
558
assert_eq ! (
580
- poly. evaluate_BE ( & point) ,
559
+ poly. evaluate ( & point) ,
581
560
remainder,
582
561
"point: {:?}, \n eval: {:?}, remainder:{:?}" ,
583
562
point,
584
- poly. evaluate_BE ( & point) ,
563
+ poly. evaluate ( & point) ,
585
564
remainder
586
565
) ;
587
566
}
0 commit comments