@@ -11,7 +11,7 @@ use super::{errors::KZG10Errors, AggregateProof, Commitment, Proof};
1111use crate :: { fft:: Polynomial , transcript:: TranscriptProtocol , util} ;
1212use anyhow:: { Error , Result } ;
1313use dusk_bls12_381:: {
14- multiscalar_mul:: msm_variable_base, G1Affine , G1Projective , G2Affine , G2Prepared , Scalar ,
14+ multiscalar_mul:: msm_variable_base, BlsScalar , G1Affine , G1Projective , G2Affine , G2Prepared ,
1515} ;
1616use merlin:: Transcript ;
1717
@@ -122,7 +122,7 @@ impl CommitKey {
122122 /// However we note that the quotient polynomial is invariant under the value f(z)
123123 /// ie. only the remainder changes. We can therefore compute the witness as f(x) / x - z
124124 /// and only use the remainder term f(z) during verification.
125- pub fn compute_single_witness ( & self , polynomial : & Polynomial , point : & Scalar ) -> Polynomial {
125+ pub fn compute_single_witness ( & self , polynomial : & Polynomial , point : & BlsScalar ) -> Polynomial {
126126 // Computes `f(x) / x-z`, returning it as the witness poly
127127 polynomial. ruffini ( * point)
128128 }
@@ -133,7 +133,7 @@ impl CommitKey {
133133 pub ( crate ) fn compute_aggregate_witness (
134134 & self ,
135135 polynomials : & [ Polynomial ] ,
136- point : & Scalar ,
136+ point : & BlsScalar ,
137137 transcript : & mut Transcript ,
138138 ) -> Polynomial {
139139 let challenge = transcript. challenge_scalar ( b"aggregate_witness" ) ;
@@ -155,8 +155,8 @@ impl CommitKey {
155155 pub fn open_single (
156156 & self ,
157157 polynomial : & Polynomial ,
158- value : & Scalar ,
159- point : & Scalar ,
158+ value : & BlsScalar ,
159+ point : & BlsScalar ,
160160 ) -> Result < Proof , Error > {
161161 let witness_poly = self . compute_single_witness ( polynomial, point) ;
162162 Ok ( Proof {
@@ -172,8 +172,8 @@ impl CommitKey {
172172 pub fn open_multiple (
173173 & self ,
174174 polynomials : & [ Polynomial ] ,
175- evaluations : Vec < Scalar > ,
176- point : & Scalar ,
175+ evaluations : Vec < BlsScalar > ,
176+ point : & BlsScalar ,
177177 transcript : & mut Transcript ,
178178 ) -> Result < AggregateProof , Error > {
179179 // Commit to polynomials
@@ -243,7 +243,7 @@ impl OpeningKey {
243243
244244 /// Checks that a polynomial `p` was evaluated at a point `z` and returned the value specified `v`.
245245 /// ie. v = p(z).
246- pub fn check ( & self , point : Scalar , proof : Proof ) -> bool {
246+ pub fn check ( & self , point : BlsScalar , proof : Proof ) -> bool {
247247 let inner_a: G1Affine =
248248 ( proof. commitment_to_polynomial . 0 - ( self . g * proof. evaluated_point ) ) . into ( ) ;
249249
@@ -262,7 +262,7 @@ impl OpeningKey {
262262 /// Checks whether a batch of polynomials evaluated at different points, returned their specified value.
263263 pub fn batch_check (
264264 & self ,
265- points : & [ Scalar ] ,
265+ points : & [ BlsScalar ] ,
266266 proofs : & [ Proof ] ,
267267 transcript : & mut Transcript ,
268268 ) -> Result < ( ) , Error > {
@@ -273,7 +273,7 @@ impl OpeningKey {
273273 let powers = util:: powers_of ( & challenge, proofs. len ( ) - 1 ) ;
274274 // Instead of multiplying g and gamma_g in each turn, we simply accumulate
275275 // their coefficients and perform a final multiplication at the end.
276- let mut g_multiplier = Scalar :: zero ( ) ;
276+ let mut g_multiplier = BlsScalar :: zero ( ) ;
277277
278278 for ( ( proof, challenge) , point) in proofs. iter ( ) . zip ( powers) . zip ( points) {
279279 let mut c = G1Projective :: from ( proof. commitment_to_polynomial . 0 ) ;
@@ -332,7 +332,7 @@ mod test {
332332 fn test_basic_commit ( ) {
333333 let degree = 25 ;
334334 let ( proving_key, opening_key) = setup_test ( degree) ;
335- let point = Scalar :: from ( 10 ) ;
335+ let point = BlsScalar :: from ( 10 ) ;
336336
337337 let poly = Polynomial :: rand ( degree, & mut rand:: thread_rng ( ) ) ;
338338 let value = poly. evaluate ( & point) ;
@@ -347,8 +347,8 @@ mod test {
347347 let degree = 25 ;
348348 let ( proving_key, vk) = setup_test ( degree) ;
349349
350- let point_a = Scalar :: from ( 10 ) ;
351- let point_b = Scalar :: from ( 11 ) ;
350+ let point_a = BlsScalar :: from ( 10 ) ;
351+ let point_b = BlsScalar :: from ( 11 ) ;
352352
353353 // Compute secret polynomial a
354354 let poly_a = Polynomial :: rand ( degree, & mut rand:: thread_rng ( ) ) ;
@@ -378,7 +378,7 @@ mod test {
378378 fn test_aggregate_witness ( ) {
379379 let max_degree = 27 ;
380380 let ( proving_key, opening_key) = setup_test ( max_degree) ;
381- let point = Scalar :: from ( 10 ) ;
381+ let point = BlsScalar :: from ( 10 ) ;
382382
383383 // Committer's View
384384 let aggregated_proof = {
@@ -415,8 +415,8 @@ mod test {
415415 fn test_batch_with_aggregation ( ) {
416416 let max_degree = 28 ;
417417 let ( proving_key, opening_key) = setup_test ( max_degree) ;
418- let point_a = Scalar :: from ( 10 ) ;
419- let point_b = Scalar :: from ( 11 ) ;
418+ let point_a = BlsScalar :: from ( 10 ) ;
419+ let point_b = BlsScalar :: from ( 11 ) ;
420420
421421 // Committer's View
422422 let ( aggregated_proof, single_proof) = {
0 commit comments