Skip to content

Replace Fixed Randomness with Halo2 Fiat Shamir Transformation#39

Open
span14 wants to merge 17 commits intoddkang:mainfrom
span14:main
Open

Replace Fixed Randomness with Halo2 Fiat Shamir Transformation#39
span14 wants to merge 17 commits intoddkang:mainfrom
span14:main

Conversation

@span14
Copy link

@span14 span14 commented Sep 11, 2023

This PR uses extra columns to hold the witnesses in the first phase to generate a commitment. This commitment can be used for randomness generation and the rest of the processes remain the same.

Places to Improve:

  • Column amounts can be shortened as there is no functionality associated with those columns. They are simply placeholders.
  • "The rest of the processes remain the same" means that the original columns are still filled out by the tensors at the beginning. Therefore, the circuit can reduce some overhead by enforcing copy constraints between the extra columns(what this PR adds) and the normal ones.

Cargo.toml Outdated
[dependencies]
bitvec = "1.0.1"
halo2 = { git="https://github.com/privacy-scaling-explorations/halo2", package="halo2", rev="17e9765c199670534c0299c96128d0464a188d0b" }
halo2_curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "0.3.3", package = "halo2curves" }
Copy link
Owner

Choose a reason for hiding this comment

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

Use the same revision as the other ones

panic!("Must specify kzg or ipa");
}

Copy link
Owner

Choose a reason for hiding this comment

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

Get rid of extraneous changes

let mut x_pos = x - div_outp_min_val_i64;
if !relu_map.contains_key(&(x_pos)) {
println!("x: {}, x_pos: {}", x, x_pos);
// println!("x: {}, x_pos: {}", x, x_pos);
Copy link
Owner

Choose a reason for hiding this comment

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

Extraneous

let mut x_pos = x - div_outp_min_val_i64;
if !relu_map.contains_key(&(x_pos)) {
println!("x: {}, x_pos: {}", x, x_pos);
// println!("x: {}, x_pos: {}", x, x_pos);
Copy link
Owner

Choose a reason for hiding this comment

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

Extraneous

@ddkang
Copy link
Owner

ddkang commented Sep 11, 2023

I don't think this is secure.

.collect();
let public_vals_u8_size = serialize(&public_vals_u8, "public_vals");
println!("Public vals size: {} bytes", public_vals_u8_size);

Copy link
Owner

Choose a reason for hiding this comment

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

Extranous changes

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.

2 participants