Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
bf4fe6c
added TAGS to .gitignore
Jun 24, 2022
cd4336c
added BLS12-381 curve to CMakeLists.txt
Jun 24, 2022
9e83435
added test for plonk in CMakeLists.txt
Jun 24, 2022
e7e208c
plonk: implemented common untility functions
Jun 27, 2022
46f89a2
plonk: implemented circuit description class
Jun 27, 2022
591ec92
plonk: implemented srs class
Jun 27, 2022
6ecf056
plonk: implemented prover class
Jun 27, 2022
55f0f12
plonk: implemented verifier class
Jun 27, 2022
82ddddf
plonk: added tests and test vector values
Jun 27, 2022
e9ebc12
plonk: added tests and test vector values; minor fixes to formatting …
Jun 27, 2022
efd9f9b
plonk: fixed formatting with clang-format-11
Jun 28, 2022
bfe869c
plonk: added updated version of libff with support for curve bls12-381
Jun 28, 2022
20dadc0
plonk: replaced all DEBUG guards with DEBUG_PLONK to avoid redeclarat…
Jun 28, 2022
357dffc
plonk: fixed unused variable compilation error
Jun 28, 2022
75e79f4
plonk: removed unused Lagrange basis input parameter from function pl…
Jun 29, 2022
056db0b
plonk: changed include-s of local files to be added with "" rather th…
Jun 30, 2022
6814299
plonk: moved libff and libfqfft include headers from test_plonk.cpp t…
Jun 30, 2022
43517b7
plonk: removed local alias of polynomial and replaced with the global…
Jun 30, 2022
514c3e6
plonk: removed the template parameter ppT from the plonk_example clas…
Jul 1, 2022
00bff4f
plonk: added missing #include <vector> to polynomial.hpp and included…
Jul 1, 2022
350f500
plonk: renamed NUM_HGEN to NUM_HSETS and fixed corresponding comment
Jul 1, 2022
4bd6244
plonk: removed an extra copy of f_points in plonk_interpolate_polynom…
Jul 1, 2022
f65b048
plonk: added empty line between all class members for improved readab…
Jul 1, 2022
9286c7d
plonk: moved function plonk_curcuit_description_from_example to test_…
Jul 1, 2022
fcb19b2
plonk: added the maximum degree of the monomials in the usrs to be an…
Jul 1, 2022
f91823e
plonk: removed macro MAX_DEGREE specifying the maximum monomial degre…
Jul 7, 2022
b1792f8
plonk: added constructor to structure circuit_t
Jul 7, 2022
5aa5d20
plonk: added clarification of the purpose of the circuit_t strcuture …
Jul 7, 2022
d333ca9
plonk: removed unused function check_field_element
Jul 7, 2022
7bf8843
plonk: improved efficiency in the computation of the roots of unity o…
Jul 7, 2022
24ad6de
plonk: corrected description of function plonk_compute_roots_of_unity…
Jul 8, 2022
9d35d55
plonk: added minor correction of "encrypted" to "encoded" in comments
Jul 8, 2022
94f8494
plonk: modified function plonk_compute_roots_of_unity_omega to alloca…
Jul 8, 2022
33a80c3
plonk: replaced function plonk_roots_of_unity_omega_to_subgroup_H wit…
Jul 8, 2022
f1409f8
plonk: fixed typo in comments
Jul 8, 2022
e04ecdf
plonk: removed extra output specifed in the Doxygen comments to plonk…
Jul 8, 2022
8d5ed16
plonk: replaced type of constant parameter nwitness from int to const…
Jul 8, 2022
341a12c
plonk: created a separate struct to contain all hashes of the communi…
Jul 8, 2022
42a979c
plonk: added the witness vlaues to be passed as an input to prover::c…
Jul 8, 2022
f71b60f
plonk: implemented unit tests for prover rounds 1,2,3,4,5.
Jul 8, 2022
a35d1cb
plonk: broke down test_plonk into three separate unit tests: test_plo…
Jul 11, 2022
7ff9c7f
plonk: added the hashes of the communication transcript (challenges a…
Jul 11, 2022
4f7f908
plonk: implemented unit tests for verifier steps 1-12
Jul 11, 2022
49d652d
plonk: moved all constructors from the *.hpp files to the correspondi…
Jul 13, 2022
61ebc3c
plonk: renamed plonk.* to utils.* to better reflect the content of th…
Jul 13, 2022
a281e27
plonk: renamed plonk_multiplicative_subgroups_H_k1H_k2H to plonk_comp…
Jul 13, 2022
51439d1
plonk: removed obsolete function plonk_interpolate_over_lagrange_basis
Jul 13, 2022
30b026a
plonk: removed exit(EXIT_FAILURE) in several exception handles so tha…
Jul 13, 2022
eefca7e
plonk: modified functions plonk_permute_subgroup_H and plonk_compute_…
Jul 13, 2022
bd6084d
plonk: renamed input parameter n of plonk_compute_permutation_polynom…
Jul 13, 2022
e589920
plonk: fixed typo in comments
Jul 13, 2022
6b2d65d
plonk: fixed multiple input parameters to prover functions to be pass…
Jul 13, 2022
2d50edf
plonk: corrected comment
Jul 13, 2022
a6dbb31
plonk: added missing reference to the reference Python implementation…
Jul 13, 2022
ec7c826
plonk: modified plonk_verifier<ppT>::step_four() to directly pass the…
Jul 13, 2022
533cc49
plonk: removed check that we are on the BLS12-381 in view of the fact…
Jul 13, 2022
a5de10c
plonk: remove all all try-catch clauses and let the caller handle the…
Jul 20, 2022
d20f7ca
plonk: fixed functions plonk_compute_accumulator and plonk_compute_se…
Jul 22, 2022
dd32274
plonk: removed storing the pre-computed Lagrange basis as part of the…
Jul 22, 2022
54a368d
plonk: added the libfqfft domain parameter as part of the srs. corres…
Jul 25, 2022
50621cf
plonk: added the 0-th Lagrange basis polynomial in the SRS instead of…
Aug 17, 2022
da267da
plonk: removed unused function plonk_compute_lagrange_basis()
Aug 18, 2022
031a300
plonk: updated depedent library libff to latest version
Jul 25, 2022
4fdd45e
plonk: move print_vector function to libff (cf. Issue https://github.…
Aug 17, 2022
9a52cf8
plonk: updated libff from 6dee67e to f9a588c in order to include the …
Aug 17, 2022
bc56a63
plonk: prepended explicitly libff:: to every call to print_vector whi…
Aug 26, 2022
915015d
plonk: replaced structure transcript_hash_t with class transcript_has…
Jul 21, 2022
4c66677
plonk: implementation of transcript hasher, addressing issue #56 and …
Aug 16, 2022
73ff038
plonk: moved the initialisation of the array of expected hash values …
Aug 17, 2022
8d6494d
plonk: removed catching the invalid size exception within the get_has…
Aug 17, 2022
24f3ae7
plonk: removed computation of the challenge u at the end of the prove…
Aug 18, 2022
c66787d
plonk: use std::count to check if the hasher buffer is of valid lengt…
Aug 18, 2022
8e3ac3b
plonk: removed doc comments /// from cpp and tcc files. left only in …
Aug 19, 2022
afdd4df
plonk: moved constructor of transcipt_hasher class as first method in…
Aug 19, 2022
c6396cf
plonk: added back the computation of the multipoint challenge u in th…
Aug 26, 2022
d001bd3
plonk: in transcript_hasher removed the private buffer variable as an…
Aug 26, 2022
a1f1806
plonk: moved function signature comments from .tcc to .hpp files only…
Sep 5, 2022
a9d084d
plonk: replaced test values in transcript_hasher with values from the…
Sep 8, 2022
1b6bb12
plonk: removed redundant debug info and unreachable debug checks. add…
Sep 8, 2022
0d85885
plonk: set transcript hasher constants alpha, beta, ... to type const…
Sep 8, 2022
c281281
plonk: added the transcript_hasher class as an additional specializat…
Sep 12, 2022
f92f12d
plonk: created a new transcript_hasher.hpp file with just a comment t…
Sep 12, 2022
825d65c
plonk: replaced the checks over all valid buffer lengths in the trans…
Sep 12, 2022
23a6bb0
plonk: replaced challenge_str map with a vector. addresses https://gi…
Sep 13, 2022
f43ec83
plonk: combine two error checks that are functionally the same into o…
Sep 13, 2022
29ca79d
plonk: declared const challenge upon assignment in bls12_381_test_ve…
Sep 13, 2022
f314a57
plonk: removed redundant this-> in get_hash. addresses https://github…
Sep 13, 2022
b8d85a2
plonk: created length and challenge arrays as const members of class …
Sep 13, 2022
af0d012
plonk: amended comments to transcript hasher code according to sugges…
Sep 14, 2022
89c91f6
plonk: replaced while loop in get_hash with for loop; assert-ed that …
Sep 15, 2022
75176fe
plonk: renamed example.tcc to example.cpp. added example.cpp and bls1…
Sep 16, 2022
b3a2fff
plonk: formatted example.cpp with latest version of clang-format-11
Oct 13, 2022
00729f5
plonk: removed dummy functions for verifier steps 1,2,3
Oct 13, 2022
f51b9eb
plonk: added support for BW6_761, BLS12_377 in CMakeLists.txt
Oct 25, 2022
5426fac
plonk: updated depends/libff to latest revision
Oct 25, 2022
b5278a6
plonk: added domain parameter as input to several functions in prover…
Oct 25, 2022
32d9b57
plonk: removed domain parameter from the srs class
Oct 26, 2022
aee3a95
plonk: added domain parameter as a new input to multiple functions as…
Oct 26, 2022
de332a8
plonk: added domain parameter as a new input to multiple functions in…
Oct 26, 2022
e5e3ddb
plonk: added domain parameter as an additional input parameter to sev…
Oct 26, 2022
a0ea6eb
plonk: edited input and output parameters in all headers to correspon…
Nov 4, 2022
5de0232
Merge pull request #70 from clearmatics/69-plonk-remove-domain-from-srs
dtebbs Nov 4, 2022
19b52c3
plonk: updated plonk_circuit_description_from_example to accept only …
Nov 9, 2022
dc914ac
plonk: updated example circuit description in comments in example.hpp
Nov 11, 2022
5fae424
plonk: renamed public_input and public_input_index respectively to PI…
Nov 14, 2022
932d2a2
plonk: added wire indices of the public inputs to the srs. made corre…
Nov 14, 2022
562229c
plonk: removed PI polynomial from srs, circuit and example. it is now…
Nov 15, 2022
0069e9c
plonk: added the witness as an additional input to prover round_three…
Nov 16, 2022
65f377f
plonk: added the list of public input values as an additional input t…
Nov 16, 2022
36fb156
plonk: added the gates matrix as input to the circuit description ins…
Nov 16, 2022
5a674e3
plonk: modified plonk_srs_derive_from_usrs to accept usrs, gates matr…
Nov 16, 2022
f77c857
plonk: removed redundant circuit_t structure together with all relate…
Nov 16, 2022
c038bd3
plonk: hard-coded the values for k1 and k2 instead of loading them fr…
Nov 16, 2022
c94ce10
plonk: removed debug checks using the exampe class which is out of sc…
Nov 23, 2022
b887d21
plonk: changed variable name *_power_of_x to *_coordinate_x in PI pol…
Nov 23, 2022
e5f1ca7
plonk: changed variable name PI_wire_index to PI_wire_indices (https:…
Nov 23, 2022
1e68509
plonk: removed redundant debug info (https://github.com/clearmatics/l…
Nov 23, 2022
bec34ee
plonk: fixed comment to refer to the correct function name (https://g…
Nov 23, 2022
ae7eadc
plonk: removed obsolete macro DEBUG_PLONK (https://github.com/clearma…
Nov 23, 2022
e37f52f
plonk: renamed variable H_gen to H_prime to be consistent with the pa…
Nov 23, 2022
95c39a9
plonk: removed obsolete reference to circuit struct in comments
Nov 23, 2022
98be246
plonk: added more efficient allocation of vector secret_powers_g1 (ht…
Nov 23, 2022
5a453cf
plonk: removed unnecessary intermediate variable in the computation o…
Nov 23, 2022
023d789
plonk: changed signature of function plonk_gates_matrix_transpose to …
Nov 23, 2022
fe272b2
plonk: moved comment regarding optimisation in representing the ident…
Nov 23, 2022
7da9f61
plonk: clarified the origin of the constants k1,k2 in comments (https…
Nov 25, 2022
65ee138
plonk: changed variables to const (https://github.com/clearmatics/lib…
Nov 25, 2022
f689497
plonk: added minor edits to comments
Nov 25, 2022
ce9c25c
Merge pull request #91 from clearmatics/86-plonk-public-input-indices…
dtebbs Nov 28, 2022
1ae5338
Merge pull request #84 from clearmatics/83-plonk-srs-from-matrix
dtebbs Nov 28, 2022
0d3a5d4
plonk: added functions to generate constants k1,k2 (section 8.1 [GWC1…
Nov 29, 2022
56c73c4
plonk: removed size n of the subrgroup H as input to the k1,k2 functi…
Nov 30, 2022
97f1464
plonk: changed variable names in k1,k2 functions to more meaningful n…
Nov 30, 2022
b9748bc
plonk: removed redundant variable b_valid (https://github.com/clearma…
Nov 30, 2022
c0b31b9
plonk: clarified parts of the test code for the k1,k2 constants in co…
Nov 30, 2022
e7c72c1
plonk: added function to deterministically generate values for the co…
Nov 30, 2022
5b157e5
plonk: added unit tests for all curves for the function choosing the …
Dec 1, 2022
6d3fc29
plonk: edited comments to valid k1,k2 tests (https://github.com/clear…
Dec 6, 2022
82e39f9
plonk: added unit test for the randomized generation of constants k1,…
Dec 6, 2022
f8a0eaa
plonk: added validity assertion check in functions generating constan…
Dec 6, 2022
aed4aca
plonk: fixed several comments -- grammar + moving part of comments to…
Dec 6, 2022
a8d0771
plonk: added validity check 2 for constants k1,k2 to the generic unit…
Dec 15, 2022
e292c7d
plonk: moved comment inside function plus other minor edits (https://…
Dec 15, 2022
2aa6416
plonk: removed ppT template parameter from bls12-381-specific test fu…
Dec 15, 2022
eeecd71
plonk: edited sentences in comments to start with capital letter and …
Dec 15, 2022
faf0642
plonk: changed several variables to const type and removed an extra v…
Dec 15, 2022
8fe3f2d
Merge pull request #94 from clearmatics/70-plonk-setting-k1-k2
dtebbs Jan 10, 2023
4ba7fde
plonk: added helper function for preparing the gates matrix (Issue ht…
Dec 7, 2022
b5c3d86
plonk: added assert for the size of the returned gates matrix (https:…
Dec 9, 2022
1c231c9
plonk: added proof and verfication for a simple circuit to test the c…
Dec 12, 2022
a8df063
plonk: added edits and clarifications in comments regarding preparati…
Dec 15, 2022
712e50d
plonk: moved the gates matrix check into a separate unit test (https:…
Dec 15, 2022
38d9067
plonk: added correction in the copy-constraints permutation, accordin…
Jan 9, 2023
960506b
plonk: added edits in comments
Jan 9, 2023
7fb0106
plonk: added a wrapper for plonk_srs_derive_from_usrs_custom_PI_indic…
Jan 10, 2023
f748170
plonk: addressed latest PR #97 comments: function renaming, comments …
Jan 13, 2023
f2a21f2
Merge pull request #97 from clearmatics/89-plonk-helper-prepare-matrix
dtebbs Jan 17, 2023
26cfe45
Merge branch 'develop' into plonk
Jan 25, 2023
be86180
plonk: added dummy transcript hasher specialized for all curves; adde…
Jan 19, 2023
3603f95
plonk: removed unused method buffer_size (https://github.com/clearmat…
Feb 3, 2023
cf7910d
Merge pull request #107 from clearmatics/103-plonk-simple-circuit-all…
dtebbs Feb 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ libsnark/zk_proof_systems/zksnark/ram_zksnark/tests/test_ram_zksnark

build
*~
TAGS
.dir-locals.el
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set(
"BN128"
CACHE
STRING
"Default curve: one of ALT_BN128, BN128, EDWARDS, MNT4, MNT6"
"Default curve: one of ALT_BN128, BN128, EDWARDS, MNT4, MNT6, BW6_761, BLS12_377, BLS12_381"
)

option(
Expand Down
2 changes: 1 addition & 1 deletion depends/libff
Submodule libff updated 40 files
+1 −0 .gitignore
+1 −1 CMakeLists.txt
+2 −0 libff/algebra/curves/alt_bn128/alt_bn128_pp.cpp
+2 −0 libff/algebra/curves/alt_bn128/alt_bn128_pp.hpp
+2 −0 libff/algebra/curves/bls12_377/bls12_377_pp.cpp
+2 −0 libff/algebra/curves/bls12_377/bls12_377_pp.hpp
+10 −0 libff/algebra/curves/bls12_381/README.md
+68 −0 libff/algebra/curves/bls12_381/bls12_381.sage
+464 −0 libff/algebra/curves/bls12_381/bls12_381_g1.cpp
+113 −0 libff/algebra/curves/bls12_381/bls12_381_g1.hpp
+486 −0 libff/algebra/curves/bls12_381/bls12_381_g2.cpp
+120 −0 libff/algebra/curves/bls12_381/bls12_381_g2.hpp
+628 −0 libff/algebra/curves/bls12_381/bls12_381_init.cpp
+63 −0 libff/algebra/curves/bls12_381/bls12_381_init.hpp
+532 −0 libff/algebra/curves/bls12_381/bls12_381_pairing.cpp
+117 −0 libff/algebra/curves/bls12_381/bls12_381_pairing.hpp
+52 −0 libff/algebra/curves/bls12_381/bls12_381_pp.cpp
+54 −0 libff/algebra/curves/bls12_381/bls12_381_pp.hpp
+2 −0 libff/algebra/curves/bn128/bn128_pp.cpp
+2 −0 libff/algebra/curves/bn128/bn128_pp.hpp
+2 −0 libff/algebra/curves/bw6_761/bw6_761_pp.cpp
+2 −0 libff/algebra/curves/bw6_761/bw6_761_pp.hpp
+17 −1 libff/algebra/curves/curve_serialization.tcc
+2 −0 libff/algebra/curves/curve_utils.tcc
+2 −0 libff/algebra/curves/edwards/edwards_pp.cpp
+2 −0 libff/algebra/curves/edwards/edwards_pp.hpp
+2 −0 libff/algebra/curves/mnt/mnt4/mnt4_pp.cpp
+2 −0 libff/algebra/curves/mnt/mnt4/mnt4_pp.hpp
+2 −0 libff/algebra/curves/mnt/mnt6/mnt6_pp.cpp
+2 −0 libff/algebra/curves/mnt/mnt6/mnt6_pp.hpp
+3 −1 libff/algebra/curves/public_params.hpp
+8 −1 libff/algebra/curves/tests/test_bilinearity.cpp
+47 −1 libff/algebra/curves/tests/test_groups.cpp
+3 −0 libff/algebra/fields/field_utils.hpp
+111 −14 libff/algebra/fields/field_utils.tcc
+34 −0 libff/algebra/fields/fp12_2over3over2.hpp
+35 −0 libff/algebra/fields/fp12_2over3over2.tcc
+31 −0 libff/algebra/fields/fp6_3over2.hpp
+19 −6 libff/algebra/fields/tests/test_fields.cpp
+36 −28 libff/algebra/scalar_multiplication/tests/test_multiexp.cpp
1 change: 1 addition & 0 deletions libsnark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ if ("${IS_LIBSNARK_PARENT}")
libsnark_test(test_r1cs_ppzksnark_verifier_gadget gadgetlib1/tests/test_r1cs_ppzksnark_verifier_gadget.cpp)
libsnark_test(test_r1cs_gg_ppzksnark_verifier_gadget gadgetlib1/tests/test_r1cs_gg_ppzksnark_verifier_gadget.cpp)
libsnark_test(test_kzg10_verifier_gadget gadgetlib1/tests/test_kzg10_verifier_gadget.cpp)
libsnark_test(test_plonk zk_proof_systems/plonk/tests/example.cpp zk_proof_systems/plonk/tests/bls12_381_test_vector_transcript_hasher.cpp zk_proof_systems/plonk/tests/test_plonk.cpp)

# TODO (howardwu): Resolve runtime on targets:
# libsnark_test(zk_proof_systems_uscs_ppzksnark_test zk_proof_systems/ppzksnark/uscs_ppzksnark/tests/test_uscs_ppzksnark.cpp)
Expand Down
2 changes: 2 additions & 0 deletions libsnark/common/data_structures/polynomial.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef __LIBSNARK_COMMON_DATA_STRUCTURES_POLYNOMIAL_HPP__
#define __LIBSNARK_COMMON_DATA_STRUCTURES_POLYNOMIAL_HPP__

#include <vector>

namespace libsnark
{

Expand Down
32 changes: 32 additions & 0 deletions libsnark/transcript_hasher/transcript_hasher.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/** @file
*****************************************************************************
* @author This file is part of libff, developed by Clearmatics Ltd
* (originally developed by SCIPR Lab) and contributors
* (see AUTHORS).
* @copyright MIT license (see LICENSE file)
*****************************************************************************/

#ifndef LIBSNARK_TRANSCRIPT_HASHER_TRANSCRIPT_HASHER_HPP_
#define LIBSNARK_TRANSCRIPT_HASHER_TRANSCRIPT_HASHER_HPP_

// // interface for a common transcript_hasher class used to implement
// // functionality for hashing the communication transcript in ZK proof
// // systems under ./zk_proof_systems
// template<typename ppT> class transcript_hasher
// {
// public:
// transcript_hasher();
//
// // add an Fr element to the transcript buffer for hashing
// void add_element(const libff::Fr<ppT> &element);
// // add the coordinates of a G1 curve point to the transcript buffer for
// // hashing
// void add_element(const libff::G1<ppT> &element);
// // add the coordinates of a G2 curve point to the transcript buffer for
// // hashing
// void add_element(const libff::G2<ppT> &element);
// // return the hash value of the communication transcript
// libff::Fr<ppT> get_hash();
// };

#endif // LIBSNARK_ZK_PROOF_SYSTEMS_PLONK_SRS_HPP_
Loading