Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize Test #12

Open
wants to merge 26 commits into
base: feature/base
Choose a base branch
from
Open

Generalize Test #12

wants to merge 26 commits into from

Conversation

grandchildrice
Copy link
Contributor

No description provided.

Comment on lines +276 to 303
fn test_invalid_instance() {
let (public_key, private_key) = test_gen_key();
let hashed_msg = test_hash_rng();
let sign = test_sign(private_key, hashed_msg);
let public_key_n = BigUint::from_bytes_be(&public_key.n().clone().to_bytes_be());

// Frに変換
let pub_key_vec = vec![Fr::from(3274), Fr::from(32344)];
let sign_vec = vec![Fr::from(3274), Fr::from(32344)];
let hashed_msg_vec = vec![Fr::from(3274), Fr::from(32344)];

// 公開鍵、署名、ハッシュされたメッセージを結合
let public_inputs = pub_key_vec
.iter()
.chain(sign_vec.iter())
.chain(hashed_msg_vec.iter())
.cloned()
.collect::<Vec<Fr>>();

let circuit =
DefaultMynaCircuit::<Fr>::new(
hashed_msg.to_vec(),
sign.to_vec(),
public_key_n
);
let prover = MockProver::run(19, &circuit, vec![public_inputs]).unwrap();
assert!(prover.verify().is_err());
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test now fails because the circuit passes any instances

@motemotech
Copy link
Contributor

@0xvon
I guess the structure is already changed a lot.
Pls confirm new repo and if there is missing, pls make PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants