-
Notifications
You must be signed in to change notification settings - Fork 310
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
feat(avm): enable zeromorph in AVM verification #8111
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,30 @@ class AvmFlavor { | |
auto get_to_be_shifted() { return AvmFlavor::get_to_be_shifted<DataType>(*this); } | ||
}; | ||
|
||
using VerificationKey = VerificationKey_<PrecomputedEntities<Commitment>, VerifierCommitmentKey>; | ||
// Note(md): required for instantiation from the proving key - im sure there are other ways to construct this | ||
class VerificationKey : public VerificationKey_<PrecomputedEntities<Commitment>, VerifierCommitmentKey> { | ||
public: | ||
VerificationKey() = default; | ||
|
||
VerificationKey(const std::shared_ptr<ProvingKey>& proving_key) | ||
: VerificationKey_(proving_key->circuit_size, proving_key->num_public_inputs) | ||
{ | ||
for (auto [polynomial, commitment] : | ||
zip_view(proving_key->get_precomputed_polynomials(), this->get_all())) { | ||
commitment = proving_key->commitment_key->commit(polynomial); | ||
} | ||
} | ||
|
||
VerificationKey(const size_t circuit_size, | ||
const size_t num_public_inputs, | ||
std::array<Commitment, NUM_PRECOMPUTED_ENTITIES> const& precomputed_cmts) | ||
: VerificationKey_(circuit_size, num_public_inputs) | ||
{ | ||
for (auto [vk_cmt, cmt] : zip_view(this->get_all(), precomputed_cmts)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This assumes implicitly that the order of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you are right. I am relying on codegen for this. |
||
vk_cmt = cmt; | ||
} | ||
} | ||
}; | ||
|
||
class AllValues : public AllEntities<FF> { | ||
public: | ||
|
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.
just curious: why is this initialised with size 1?
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.
My understanding of the verification code for Zeromorph is that it only uses the identity point for g1 and a single g2 point to initialize the SRS. I saw that value "1" was also used for "verify_client_ivc".
My thought was to not read unnecessarily data as my assumption is that it would be safe.
Is there any security risk to initialize the CRS with a too small amount of data? Otherwise, I am happy to put it back to the same constant as in the avm_prover.
Thanks for the feedback @maramihali
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.
just looked back on what verify client_ivc_verify, makes sense