Skip to content

Commit

Permalink
Update ecdsa.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliakot authored May 20, 2023
1 parent e9386b9 commit c42a2ef
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions halo2-ecc/src/secp256k1/tests/ecdsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ use std::io::BufReader;
use std::io::Write;
use std::{fs, io::BufRead};


#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
struct CircuitParams {
strategy: FpStrategy,
Expand Down Expand Up @@ -73,7 +72,6 @@ fn ecdsa_test<F: PrimeField>(
&fp_chip, ctx, &pk, &r, &s, &m, 4, 4,
);
assert_eq!(res.value(), &F::one());

}

fn random_ecdsa_circuit(
Expand All @@ -96,13 +94,10 @@ fn random_ecdsa_circuit(
let r_point = Secp256k1Affine::from(Secp256k1Affine::generator() * k).coordinates().unwrap();
let x = r_point.x();
let x_bigint = fe_to_biguint(x);

let r = biguint_to_fe::<Fq>(&(x_bigint % modulus::<Fq>()));
let s = k_inv * (msg_hash + (r * sk));

let start0 = start_timer!(|| format!("Witness generation for circuit in {stage:?} stage"));
ecdsa_test(builder.main(0), params, r, s, msg_hash, pubkey);


let circuit = match stage {
CircuitBuilderStage::Mock => {
Expand Down Expand Up @@ -131,7 +126,6 @@ fn test_secp256k1_ecdsa() {
MockProver::run(params.degree, &circuit, vec![]).unwrap().assert_satisfied();
}


#[test]
fn bench_secp256k1_ecdsa() -> Result<(), Box<dyn std::error::Error>> {
let mut rng = OsRng;
Expand Down

0 comments on commit c42a2ef

Please sign in to comment.