Commit Graph

11 Commits

Author SHA1 Message Date
Daira Emma Hopwood 58e797da93 feat: added `to/from_bytes` for `ProvingKey` and `VerifyingKey`
* add `pack`/`unpack` helper functions between `&[bool]` and `u8`.

Extracted from 2c7f288932

Co-authored-by: Carlos Pérez <37264926+CPerezz@users.noreply.github.com>
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-05-01 16:34:40 +01:00
Daira Emma Hopwood bae30538b5 Apply review suggestions for VerifyingKey serialization:
* write an initial 0x01 version byte, and check it on read;
* use little-endian byte order for lengths;
* add length fields before the selectors and the permutation commitments,
  and check their consistency with the expected lengths on read;
* do not write an extra byte for a selector bit vector if the number of
  bits is a multiple of 8;
* ensure that original I/O errors are preserved.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-05-01 11:00:53 +01:00
Jonathan Wang 3489dcde9e fix: add `num_fixed_commitments` to vkey serialization so correct number
of fixed columns, post selector compression, are read

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-05-01 10:50:00 +01:00
Nalin Bhardwaj 0ca2296921 Vkey serialisation
Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
2023-05-01 10:48:24 +01:00
Jack Grigg cb819e47e9 Migrate to `ff` revision without `FieldExt` 2022-11-30 19:35:26 +00:00
Jack Grigg f852be62a8 halo2_proofs: Remove unused imports 2022-09-09 17:43:43 +00:00
Jack Grigg 05f37ee8a6 Cache the constraint system degree in `VerifyingKey`
This means we only compute the degree in a verification context during
construction, instead of twice per proof in the permutation argument.
2022-06-22 19:33:36 +00:00
Jack Grigg 4802936c56 Cache the representative of `VerifyingKey` used in transcripts
This means we only need to `Debug`-format the `PinnedVerificationKey`
once on construction, instead of once per proof.
2022-06-22 19:25:32 +00:00
parazyd a6d7785ddc
plonk: Derive Clone for VerifyingKey and ProvingKey.
Signed-off-by: parazyd <parazyd@dyne.org>
2022-04-26 14:08:11 +02:00
Sean Bowe f46d77763e
Remove logic for reading and writing VerificationKey to/from buffers. 2022-03-16 14:19:33 -06:00
Jack Grigg 3c6558f049 Move `halo2` code into `halo2_proofs` crate 2022-01-20 18:50:43 +00:00