@@ -46,7 +46,7 @@ use crate::{
4646use rand:: RngCore ;
4747use snarkvm_curves:: PairingEngine ;
4848use snarkvm_fields:: { One , PrimeField , ToConstraintField , Zero } ;
49- use snarkvm_utilities:: { ToBytes , to_bytes_le} ;
49+ use snarkvm_utilities:: { ToBytes , dev_eprintln , dev_println , to_bytes_le} ;
5050
5151use anyhow:: { Result , anyhow, bail, ensure} ;
5252use core:: marker:: PhantomData ;
@@ -297,10 +297,10 @@ where
297297 let circuit_id = & verifying_key. id ;
298298 let state = AHPForR1CS :: < E :: Fr , SM > :: index_helper ( circuit) ?;
299299 if state. index_info != verifying_key. circuit_info {
300- bail ! ( SNARKError :: CircuitNotFound ) ;
300+ bail ! ( "Circuit info mismatch, expected {:?}, got {:?}" , verifying_key . circuit_info , state . index_info ) ;
301301 }
302302 if state. id != * circuit_id {
303- bail ! ( SNARKError :: CircuitNotFound ) ;
303+ bail ! ( "Circuit ID mismatch, expected {:?}, got {:?}." , circuit_id , state . id ) ;
304304 }
305305
306306 // Make sure certificate is not hiding
@@ -376,10 +376,10 @@ where
376376 let num_unique_circuits = keys_to_constraints. len ( ) ;
377377 let mut circuit_ids = Vec :: with_capacity ( num_unique_circuits) ;
378378 for pk in keys_to_constraints. keys ( ) {
379- let batch_size = prover_state. batch_size ( & pk. circuit ) . ok_or ( SNARKError :: CircuitNotFound ) ?;
380- let public_input = prover_state. public_inputs ( & pk. circuit ) . ok_or ( SNARKError :: CircuitNotFound ) ?;
379+ let batch_size = prover_state. batch_size ( & pk. circuit ) . ok_or ( anyhow ! ( "Batch size not found." ) ) ?;
380+ let public_input = prover_state. public_inputs ( & pk. circuit ) . ok_or ( anyhow ! ( "Public input not found." ) ) ?;
381381 let padded_public_input =
382- prover_state. padded_public_inputs ( & pk. circuit ) . ok_or ( SNARKError :: CircuitNotFound ) ?;
382+ prover_state. padded_public_inputs ( & pk. circuit ) . ok_or ( anyhow ! ( "Padded public input not found." ) ) ?;
383383 let circuit_id = pk. circuit . id ;
384384 batch_sizes. insert ( circuit_id, batch_size) ;
385385 circuit_infos. insert ( circuit_id, & pk. circuit_verifying_key . circuit_info ) ;
@@ -766,9 +766,7 @@ where
766766 let mut new_input = Vec :: with_capacity ( input_len) ;
767767 new_input. extend_from_slice ( input) ;
768768 new_input. resize ( input_len, E :: Fr :: zero ( ) ) ;
769- if cfg ! ( debug_assertions) {
770- println ! ( "Number of padded public variables: {}" , new_input. len( ) ) ;
771- }
769+ dev_println ! ( "Number of padded public variables: {}" , new_input. len( ) ) ;
772770 let unformatted = prover:: ConstraintSystem :: unformat_public_input ( & new_input) ;
773771 ( new_input, unformatted)
774772 } )
@@ -796,7 +794,7 @@ where
796794 !proof. pc_proof . is_hiding ( ) & comms. mask_poly . is_none ( )
797795 } ;
798796 if !proof_has_correct_zk_mode {
799- eprintln ! (
797+ dev_eprintln ! (
800798 "Found `mask_poly` in the first round when not expected, or proof has incorrect hiding mode ({})" ,
801799 proof. pc_proof. is_hiding( )
802800 ) ;
@@ -1016,8 +1014,7 @@ where
10161014 end_timer ! ( pc_time) ;
10171015
10181016 if !evaluations_are_correct {
1019- #[ cfg( debug_assertions) ]
1020- eprintln ! ( "SonicKZG10::Check failed using final challenge: {:?}" , verifier_state. gamma) ;
1017+ dev_eprintln ! ( "SonicKZG10::Check failed using final challenge: {:?}" , verifier_state. gamma) ;
10211018 }
10221019
10231020 end_timer ! ( verifier_time, || format!(
0 commit comments