-
Notifications
You must be signed in to change notification settings - Fork 250
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
Conversation
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So
Parameters
is serialized asVerifyingKey || ProvingKey
?
Yes.
And for Sprout, we'll just pass the same path in to get both at proving time?
Yes. :)
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`.
Group Hash implementation in the circuit
Update librustzcash June 2020
No description provided.