forked from kroma-network/tachyon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
1,726 additions
and
2,740 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
#ifndef TACHYON_ZK_PLONK_EXAMPLES_CIRCUIT_TEST_DATA_H_ | ||
#define TACHYON_ZK_PLONK_EXAMPLES_CIRCUIT_TEST_DATA_H_ | ||
|
||
#include <stdint.h> | ||
|
||
#include <vector> | ||
|
||
#include "tachyon/base/range.h" | ||
#include "tachyon/math/elliptic_curves/bn/bn254/bn254.h" | ||
#include "tachyon/zk/base/commitments/shplonk_extension.h" | ||
#include "tachyon/zk/plonk/examples/circuit_test.h" | ||
|
||
namespace tachyon::zk::plonk::halo2 { | ||
|
||
// TODO: move somewhere else | ||
template <typename T, size_t N> | ||
const std::vector<T> ArrayToVector(const T (&arr)[N]) { | ||
return std::vector<T>(std::begin(arr), std::end(arr)); | ||
} | ||
|
||
template <typename T> | ||
const std::vector<T> ArrayToVector(const T (&arr)[0]) { | ||
return {}; | ||
} | ||
|
||
template <typename T, size_t A, size_t B> | ||
std::vector<std::vector<T>> Array2DToVector2D(const T (&arr)[A][B]) { | ||
std::vector<std::vector<T>> vec = {}; | ||
for (const auto& inner_array : arr) { | ||
vec.emplace_back(std::begin(inner_array), std::end(inner_array)); | ||
} | ||
return vec; | ||
} | ||
|
||
template <typename T> | ||
std::vector<std::vector<T>> Array2DToVector2D(const T (&arr)[0][0]) { | ||
return {}; | ||
} | ||
|
||
template <typename CircuitType, typename _ProverType> | ||
class CircuitTestData { | ||
public: | ||
using ProverType = _ProverType; | ||
|
||
constexpr static size_t kN = 1; | ||
constexpr static std::string_view kPinnedConstraintSystem = ""; | ||
constexpr static std::string_view kFixedColumnsOther[0][0] = {}; | ||
constexpr static AnyColumnKey kColumns[0] = {}; | ||
constexpr static Label kMapping[0][0] = {}; | ||
constexpr static Label kAux[0][0] = {}; | ||
constexpr static size_t kSizes[0][0] = {}; | ||
constexpr static bool kSelectors[0][0] = {}; | ||
constexpr static base::Range<RowIndex> kUsableRows = | ||
base::Range<RowIndex>::Until(10); | ||
constexpr static std::string_view kPinnedVerifyingKey = ""; | ||
constexpr static std::string_view kTranscriptRepr = ""; | ||
constexpr static std::string_view kLFirst[0] = {}; | ||
constexpr static std::string_view kLLast[0] = {}; | ||
constexpr static std::string_view kLActiveRow[0] = {}; | ||
constexpr static std::string_view kFixedColumns[0][0] = {}; | ||
constexpr static std::string_view kFixedPolys[0][0] = {}; | ||
constexpr static std::string_view kPermutationsColumns[0][0] = {}; | ||
constexpr static std::string_view kPermutationsPolys[0][0] = {}; | ||
constexpr static uint8_t kProof[0] = {}; | ||
constexpr static | ||
typename CircuitTest<ProverType>::Point kAdviceCommitments[0][0] = {}; | ||
constexpr static std::string_view kChallenges[0] = {}; | ||
constexpr static std::string_view kTheta = ""; | ||
constexpr static typename CircuitTest<ProverType>::Point | ||
kPermutationProductCommitmentsInputPoints[0][0] = {}; | ||
constexpr static typename CircuitTest<ProverType>::Point | ||
kPermutationProductCommitmentsTablePoints[0][0] = {}; | ||
constexpr static std::string_view kBeta = ""; | ||
constexpr static std::string_view kGamma = ""; | ||
constexpr static typename CircuitTest<ProverType>::Point | ||
kPermutationProductCommitments[0][0] = {}; | ||
constexpr static | ||
typename CircuitTest<ProverType>::Point kLookupProductCommitments[0][0] = | ||
{}; | ||
constexpr static std::string_view kY = ""; | ||
constexpr static | ||
typename CircuitTest<ProverType>::Point kVanishingHPolyCommitments[0] = | ||
{}; | ||
constexpr static std::string_view kX = ""; | ||
constexpr static std::string_view kAdviceEvals[0][0] = {}; | ||
constexpr static std::string_view kFixedEvals[0] = {}; | ||
constexpr static std::string_view kCommonPermutationEvals[0] = {}; | ||
constexpr static std::string_view kPermutationProductEvals[0][0] = {}; | ||
constexpr static std::string_view kPermutationProductNextEvals[0][0] = {}; | ||
constexpr static std::string_view kPermutationProductLastEvals[0][0] = {}; | ||
constexpr static std::string_view kLookupProductEvals[0][0] = {}; | ||
constexpr static std::string_view kLookupProductNextEvals[0][0] = {}; | ||
constexpr static std::string_view kLookupPermutedInputEvals[0][0] = {}; | ||
constexpr static std::string_view kLookupPermutedInputPrevEvals[0][0] = {}; | ||
constexpr static std::string_view kLookupPermutedTableEvals[0][0] = {}; | ||
constexpr static std::string_view kHEval = ""; | ||
|
||
constexpr static | ||
typename CircuitTest<ProverType>::Point kVanishingRandomPolyCommitment{ | ||
"0x0000000000000000000000000000000000000000000000000000000000000001", | ||
"0x0000000000000000000000000000000000000000000000000000000000000002"}; | ||
|
||
constexpr static std::string_view kVanishingRandomEval = | ||
"0x0000000000000000000000000000000000000000000000000000000000000001"; | ||
|
||
static CircuitType GetCircuit() { return CircuitType(); } | ||
|
||
static std::vector<CircuitType> GetCircuits() { | ||
CircuitType circuit = GetCircuit(); | ||
return {circuit, std::move(circuit)}; | ||
} | ||
|
||
static std::vector<typename ProverType::RationalEvals> GetFixedColumns() { | ||
return {}; | ||
} | ||
|
||
static std::vector<typename ProverType::Evals> GetInstanceColumns() { | ||
return {}; | ||
} | ||
}; | ||
|
||
} // namespace tachyon::zk::plonk::halo2 | ||
|
||
#endif // TACHYON_ZK_PLONK_EXAMPLES_CIRCUIT_TEST_DATA_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.