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

Ns/plug zk v2 #1846

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Ns/plug zk v2 #1846

wants to merge 3 commits into from

Conversation

nsarlin-zama
Copy link
Contributor

@nsarlin-zama nsarlin-zama commented Dec 4, 2024

closes: https://github.com/zama-ai/tfhe-rs-internal/issues/772

PR content/description

Plugs ZK V2. The CompactPkeCrs type is now an enum with a variant for V1 and V2, each holding the right 'PublicParam' type from tfhe_zk_pok. The proof is similarly wrapped in an enum. A prove method has been added on the Crs object that will generate a proof compatible with this Crs. Similarly, a verify method will always reject proofs that are not of the right kind.

Backward compatibility is maintained and old crs/proofs are automatically wrapped in the V1 scheme. A fix was needed in versionable for this, to make it handle type that evolve from #[repr(transparent)] to their own type.

By default new Crs are created using v2, but methods have been added to create a Crs with v1.

Proof conformance checks the version of the scheme.

Check-list:

  • Tests for the changes have been added -> Need to add a v2 proof in data repo
  • Param update
  • Docs have been added / updated (for bug fixes / features)
  • Relevant issues are marked as resolved/closed, related issues are linked in the description
  • Check for breaking changes (including serialization changes) and add them to commit message following the conventional commit specification

BREAKING CHANGE:
- The object ZkVerificationOutCome has been renamed ZkVerificationOutcome.
- Conformance of proofs now checks the scheme version of the CRS. This is
breaking at the shortint and core_crypto levels, and for manually built integer
conformance params.

New CRS will be generated with the V2 Scheme by default, but V1 CRS and proofs
are still accepted, so this is not breaking. New methods have been added to
generate a V1 CRS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed data_PR This is a PR that needs to fetch new data for backward compat tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant