Skip to content

feat: ideal vole and traits#384

Open
themighty1 wants to merge 6 commits into
v2from
feat/vole_core_crate
Open

feat: ideal vole and traits#384
themighty1 wants to merge 6 commits into
v2from
feat/vole_core_crate

Conversation

@themighty1
Copy link
Copy Markdown
Collaborator

@themighty1 themighty1 commented Apr 24, 2026

Summary

  • VOLE traits and their ideal functionalities (RVOLE, derandomized VOLE, RVOPE). Not exhaustive — more can be added later as needs arise.
  • pregenerate method on each ideal — a departure from the OT-ideal shape — shifts correlation materialization out of the protocol's online path to minimize online-phase latency.

@themighty1 themighty1 requested a review from sinui0 April 24, 2026 11:37
@themighty1 themighty1 force-pushed the feat/vole_core_crate branch from e3f8e33 to 317b21d Compare May 7, 2026 10:34
@themighty1 themighty1 changed the base branch from feat/qs_polynomial_proof to v2-fields May 7, 2026 10:35
@themighty1
Copy link
Copy Markdown
Collaborator Author

migrated to v2-fields and ready for review @sinui0

themighty1 and others added 2 commits May 7, 2026 11:34
Mirrors Gf2_128, which has carried these derives since #382. Adds
`#[repr(transparent)]` (required for zerocopy soundness) and the
`FromBytes`, `IntoBytes`, `Immutable`, `KnownLayout` derives.
…2^k) backends (#388)

Adds the field primitives needed by upcoming gate-by-gate ZK protocols:
- Field::square, inner_product, double_inner_product (with chunked /
  rayon-aware default impls)
- ExtensionField trait with MONOMIAL_BASIS and inner_product_subfield
- gf2_64 alongside gf2_128
- x86-64 (PCLMULQDQ) and WASM-SIMD backends for both fields, dispatched
  via cfg_select
Base automatically changed from v2-fields to v2 May 7, 2026 16:13
sinui0 and others added 4 commits May 7, 2026 09:15
…it (#389)

* feat(mpz-fields): inner products, ExtensionField, and accelerated GF(2^k) backends

Adds the field primitives needed by upcoming gate-by-gate ZK protocols:
- Field::square, inner_product, double_inner_product (with chunked /
  rayon-aware default impls)
- ExtensionField trait with MONOMIAL_BASIS and inner_product_subfield
- gf2_64 alongside gf2_128
- x86-64 (PCLMULQDQ) and WASM-SIMD backends for both fields, dispatched
  via cfg_select

* feat: add mpz-circuits-new crate with Context trait and SHA-256 circuit

A field-generic circuit-evaluation abstraction. The `Context` trait
exposes `add` / `sub` / `mul` / `mul_const` / `constant` /
`assert_const` / `assert_eq` over an associated `Wire` type, so the
same circuit code drives plain-bit witness evaluation, ZK provers,
and ZK verifiers without modification.

Includes:
- `Context` trait + `MaybeConst<Wire, Field>` return type for
  `mul_const` (skips communication when one operand is a known
  constant).
- `WitnessCtx` impl: plain-field arithmetic, AND-gate outputs
  appended to a witness tape.
- Hand-written SHA-256 compression circuit (`sha256::compress`)
  with the constant `AND_PER_BLOCK` and initial state `H0` exported.
- Criterion bench for SHA-256 over the witness context.
* feat(mpz-fields): inner products, ExtensionField, and accelerated GF(2^k) backends

Adds the field primitives needed by upcoming gate-by-gate ZK protocols:
- Field::square, inner_product, double_inner_product (with chunked /
  rayon-aware default impls)
- ExtensionField trait with MONOMIAL_BASIS and inner_product_subfield
- gf2_64 alongside gf2_128
- x86-64 (PCLMULQDQ) and WASM-SIMD backends for both fields, dispatched
  via cfg_select

* feat: add mpz-circuits-new crate with Context trait and SHA-256 circuit

A field-generic circuit-evaluation abstraction. The `Context` trait
exposes `add` / `sub` / `mul` / `mul_const` / `constant` /
`assert_const` / `assert_eq` over an associated `Wire` type, so the
same circuit code drives plain-bit witness evaluation, ZK provers,
and ZK verifiers without modification.

Includes:
- `Context` trait + `MaybeConst<Wire, Field>` return type for
  `mul_const` (skips communication when one operand is a known
  constant).
- `WitnessCtx` impl: plain-field arithmetic, AND-gate outputs
  appended to a witness tape.
- Hand-written SHA-256 compression circuit (`sha256::compress`)
  with the constant `AND_PER_BLOCK` and initial state `H0` exported.
- Criterion bench for SHA-256 over the witness context.

* feat: add mpz-zk-core-new — QuickSilver gate-by-gate ZK protocol

Implementation of the QuickSilver protocol (Yang–Heath–Wang–Katz '21,
eprint 2021/076) Fig 5: a constant-round, gate-by-gate ZK proof system
for boolean circuits with one field element of communication per AND
gate.

- Prover / Verifier types implementing `mpz_circuits_new::Context`
  over `Wire = Gf2_128` IT-MACs.
- Pointer-bit convention: every MAC's LSB carries the authenticated
  bit, removing the need for a separate witness tape on the prover.
- Per-AND-gate triple collection + Fig-5 step-7 batch consistency
  check using `Field::double_inner_product`. ~256-element segments,
  rayon-aware (`set_stream` per segment for deterministic parallel χ).
- VOPE(1) mask packed from 128 sVOLE correlations via the monomial
  basis inner product.
- Fiat–Shamir transcript bound to: caller-seeded prefix → masked
  witness → per-`assert` public bits → assertions hash → χ.
- i.i.d. uniform χ from a ChaCha12 PRG (soundness 2/p^r ≈ 2^-127,
  tighter than the paper's t/p^r from χ^i powers).

Tests: 10 unit tests (SHA-256 round-trip + 6 negative + 3 assert_eq)
plus an end-to-end SHA-256 integration test against `sha2::compress256`.
Bench harness covers 64 B → 128 KiB messages.
@themighty1 themighty1 force-pushed the feat/vole_core_crate branch from d46f85d to ece7f7a Compare May 8, 2026 12:50
@sinui0 sinui0 force-pushed the v2 branch 2 times, most recently from 3bafd91 to 59aabd9 Compare May 20, 2026 19:00
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