Skip to content

Commit

Permalink
modify test
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamWuGit committed Oct 28, 2024
1 parent ab99141 commit cd7d774
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 0 additions & 4 deletions zkevm-circuits/src/sig_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,6 @@ impl<F: Field> SigCircuit<F> {
} = sign_data;
let (sig_r, sig_s, v) = signature;

println!("assign_ecdsa_generic: signature {:?}", signature);

// build ecc chip from Fp chip
let ecc_chip = EccChip::<F, FpConfig<F, Fp>>::construct(ecdsa_chip.clone());
// match pk {
Expand Down Expand Up @@ -589,7 +587,6 @@ impl<F: Field> SigCircuit<F> {
// constrains v == y.is_oddness()
// =======================================
assert!(*v == 0 || *v == 1, "v is not boolean");
println!("V is {}, pub key x: {:?} y: {:?}", v, x, y);

let pk_not_zero = gate.not(ctx, QuantumCell::Existing(pk_is_zero));

Expand Down Expand Up @@ -697,7 +694,6 @@ impl<F: Field> SigCircuit<F> {
QuantumCell::Existing(pk_is_zero),
);

println!("assigned_y_tmp {:?}", assigned_y_tmp);
//let ecc_chip = EccChip::<F, FpChipK1<F>>::construct(ecdsa_chip.clone());

let ecc_chip = EccChip::construct(ecdsa_chip.clone());
Expand Down
8 changes: 3 additions & 5 deletions zkevm-circuits/src/sig_circuit/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ fn sign_k1_verify() {
}

let k = LOG_TOTAL_NUM_ROWS as u32;
run::<Fr>(k, *max_sig, *max_sig, signatures, vec![]);
run::<Fr>(k, *max_sig, 0, signatures, vec![]);

log::debug!("end of testing for {} signatures", max_sig);
}
Expand Down Expand Up @@ -429,19 +429,17 @@ fn p256_sign_verify() {
#[test]
fn sign_verify() {
use super::utils::LOG_TOTAL_NUM_ROWS;
use crate::sig_circuit::utils::MAX_NUM_SIG_K1;
use crate::sig_circuit::utils::MAX_NUM_SIG_R1;
use halo2_proofs::halo2curves::bn256::Fr;
use rand::SeedableRng;
use rand_xorshift::XorShiftRng;
use sha3::{Digest, Keccak256};
let mut rng = XorShiftRng::seed_from_u64(1);

// random msg_hash
//let max_sigs = [1, 16, MAX_NUM_SIG];
let max_sigs = [1];
let max_sigs = [1, 16, MAX_NUM_SIG_R1];

for max_sig in max_sigs.iter() {
// max_sig secp256k1 and max_sig secp256r1 signatures
log::debug!("testing for {} signatures", 2 * max_sig);
let mut signatures_k1: Vec<SignData<secp256k1::Fq, Secp256k1Affine>> = Vec::new();
let mut signatures_r1: Vec<SignData<secp256r1::Fq, Secp256r1Affine>> = Vec::new();
Expand Down

0 comments on commit cd7d774

Please sign in to comment.