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

Support loading zk-SNARK parameters #4

Merged
merged 2 commits into from
Apr 19, 2018

Conversation

ebfull
Copy link
Collaborator

@ebfull ebfull commented Apr 17, 2018

No description provided.

Copy link
Contributor

@str4d str4d left a comment

Choose a reason for hiding this comment

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

utACK, comment about global bool is non-blocking.

let sprout_vk = prepare_verifying_key(&sprout_vk);

// Caller is responsible for calling this function once, so
// these global mutations are safe.
Copy link
Contributor

Choose a reason for hiding this comment

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

Or we could set a global bool, and error at the top of this function if it is already set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think this comment actually may be misleading. It's not necessarily that it should only be called once, it just needs to be called independently of any other calls, to avoid data races.

Copy link
Contributor

Choose a reason for hiding this comment

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

Opened #5 to address this later.

sprout_path: *const c_char,
) {
// These should be valid CStr's, but the decoding may fail on Windows
// so we may need to use OSStr or something.
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to know. I'm happy merging this for now, and then detecting / fixing Windows later once we have CI for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I don't know how encoding works on Windows, I just know it causes problems that require the use of insane hacks like this.

let output_params = Parameters::<Bls12>::read(&mut output_fs, false)
.expect("couldn't deserialize Sapling spend parameters file");
let sprout_vk = VerifyingKey::<Bls12>::read(&mut sprout_fs)
.expect("couldn't deserialize Sprout Groth16 verifying key");
Copy link
Contributor

Choose a reason for hiding this comment

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

So Parameters is serialized as VerifyingKey || ProvingKey? And for Sprout, we'll just pass the same path in to get both at proving time?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So Parameters is serialized as VerifyingKey || ProvingKey?

Yes.

And for Sprout, we'll just pass the same path in to get both at proving time?

Yes. :)

@ebfull ebfull merged commit 6cc1813 into zcash:master Apr 19, 2018
zkbot added a commit to zcash/zcash that referenced this pull request Apr 20, 2018
Load Sapling testnet parameters into memory

This PR depends on zcash/librustzcash#4.

The parameters are not loaded into memory if `zcashd` is configured as a mainnet node -- this is something we can change in the weeks before `2.0.0`.
str4d referenced this pull request in str4d/librustzcash Aug 28, 2018
Group Hash implementation in the circuit
str4d referenced this pull request in str4d/librustzcash Jan 6, 2019
miodragpop referenced this pull request in miodragpop/librustzcash Apr 25, 2021
Update librustzcash June 2020
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