Skip to content

Commit

Permalink
More Redshift compilation updates. #20
Browse files Browse the repository at this point in the history
  • Loading branch information
nkaskov committed Dec 13, 2021
1 parent a335176 commit 5007272
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ namespace nil {

typedef Hash transcript_hash_type;

typedef merkle_tree<Hash, 2> merkle_tree_type;
typedef merkle_proof<Hash, 2> merkle_proof_type;
typedef typename containers::merkle_tree<Hash, 2> merkle_tree_type;
typedef typename containers::merkle_proof<Hash, 2> merkle_proof_type;

constexpr static const math::polynomial::polynom<typename FieldType::value_type>
q = {0, 0, 1};
Expand Down
15 changes: 7 additions & 8 deletions include/nil/crypto3/zk/snark/systems/plonk/redshift/prover.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ namespace nil {
std::size_t lambda, std::size_t k, std::size_t r, std::size_t m=2>
class redshift_prover {

using types_policy = redshift_types_policy<FieldType, WiresAmount>;
using types_policy = detail::redshift_types_policy<FieldType, WiresAmount>;
using transcript_manifest = types_policy::prover_fiat_shamir_heuristic_manifest<6>;

typedef hashes::sha2<256> merkle_hash_type;
typedef hashes::sha2<256> transcript_hash_type;

typedef typename merkletree::MerkleTree<Hash> merkle_tree_type;
typedef typename containers::merkletree<merkle_hash_type, 2> merkle_tree_type;

constexpr static const typename FieldType::value_type omega =
algebra::get_root_of_unity<FieldType>()
typedef list_polynomial_commitment_scheme<FieldType,
Hash, lambda, k, r, m> lpc;
merkle_hash_type, lambda, k, r, m> lpc;

public:
static inline typename types_policy::proof_type<lpc>
Expand All @@ -69,8 +69,8 @@ namespace nil {

fiat_shamir_heuristic<transcript_manifest, transcript_hash_type> transcript;

... setup_values = ...;
transcript(setup_values);
// ... setup_values = ...;
// transcript(setup_values);

// 2 - Define new witness polynomials
// and 3 - Add commitments to fi to transcript
Expand Down Expand Up @@ -175,7 +175,7 @@ namespace nil {
transcript(Q_commitment);

// 13
... V = ...;
// ... V = ...;

// 14
transcript(lpc::commit(V).root());
Expand Down Expand Up @@ -220,7 +220,7 @@ namespace nil {
}

// 19
...
// ...

// 20
math::polynomial::polynom<typename FieldType::value_type> F_consolidated = 0;
Expand Down Expand Up @@ -273,7 +273,6 @@ namespace nil {
std::move(Q_lpc_proof), std::move(T_lpc_proofs));

return proof;
}
}
};
} // namespace snark
Expand Down
2 changes: 2 additions & 0 deletions include/nil/crypto3/zk/snark/systems/plonk/redshift/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
#include <nil/crypto3/math/polynomial/polynom.hpp>
#include <nil/crypto3/math/detail/field_utils.hpp>

#include <nil/crypto3/zk/snark/relations/plonk/plonk.hpp>

namespace nil {
namespace crypto3 {
namespace zk {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ namespace nil {
template<typename FieldType, std::size_t lambda, std::size_t m=2>
class redshift_verifier {

using types_policy = redshift_types_policy<FieldType>;
using types_policy = detail::redshift_types_policy<FieldType>;
using transcript_manifest = types_policy::prover_fiat_shamir_heuristic_manifest<6>;
using constraint_system_type = plonk_constraint_system<FieldType>;

typedef hashes::sha2<256> merkle_hash_type;
typedef hashes::sha2<256> transcript_hash_type;

constexpr static const std::size_t k = ...;
constexpr static const std::size_t r = ...;

constexpr static const typename FieldType::value_type omega =
algebra::get_root_of_unity<FieldType>()
typedef list_polynomial_commitment_scheme<FieldType,
Hash, lambda, k, r, m> lpc;
merkle_hash_type, lambda, k, r, m> lpc;

public:
static inline bool process(const types_policy::verification_key_type &verification_key,
Expand Down

0 comments on commit 5007272

Please sign in to comment.