-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from kroma-network/feat/implement-circuit-pol…
…y-builder feat(zk): implement combined custom gate column builder
- Loading branch information
Showing
40 changed files
with
1,136 additions
and
364 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
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,46 @@ | ||
// Copyright 2020-2022 The Electric Coin Company | ||
// Copyright 2022 The Halo2 developers | ||
// Use of this source code is governed by a MIT/Apache-2.0 style license that | ||
// can be found in the LICENSE-MIT.halo2 and the LICENCE-APACHE.halo2 | ||
// file. | ||
|
||
#ifndef TACHYON_ZK_PLONK_CIRCUIT_OWNED_TABLE_H_ | ||
#define TACHYON_ZK_PLONK_CIRCUIT_OWNED_TABLE_H_ | ||
|
||
#include <utility> | ||
#include <vector> | ||
|
||
#include "tachyon/zk/plonk/circuit/table_base.h" | ||
|
||
namespace tachyon::zk { | ||
|
||
template <typename PolyOrEvals> | ||
class OwnedTable : public TableBase<PolyOrEvals> { | ||
public: | ||
OwnedTable() = default; | ||
OwnedTable(std::vector<PolyOrEvals>&& fixed_columns, | ||
std::vector<PolyOrEvals>&& advice_columns, | ||
std::vector<PolyOrEvals>&& instance_columns) | ||
: fixed_columns_(std::move(fixed_columns)), | ||
advice_columns_(std::move(advice_columns)), | ||
instance_columns_(std::move(instance_columns)) {} | ||
|
||
absl::Span<const PolyOrEvals> fixed_columns() const override { | ||
return fixed_columns_; | ||
} | ||
absl::Span<const PolyOrEvals> advice_columns() const override { | ||
return advice_columns_; | ||
} | ||
absl::Span<const PolyOrEvals> instance_columns() const override { | ||
return instance_columns_; | ||
} | ||
|
||
protected: | ||
std::vector<PolyOrEvals> fixed_columns_; | ||
std::vector<PolyOrEvals> advice_columns_; | ||
std::vector<PolyOrEvals> instance_columns_; | ||
}; | ||
|
||
} // namespace tachyon::zk | ||
|
||
#endif // TACHYON_ZK_PLONK_CIRCUIT_OWNED_TABLE_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2020-2022 The Electric Coin Company | ||
// Copyright 2022 The Halo2 developers | ||
// Use of this source code is governed by a MIT/Apache-2.0 style license that | ||
// can be found in the LICENSE-MIT.halo2 and the LICENCE-APACHE.halo2 | ||
// file. | ||
|
||
#ifndef TACHYON_ZK_PLONK_CIRCUIT_REF_TABLE_H_ | ||
#define TACHYON_ZK_PLONK_CIRCUIT_REF_TABLE_H_ | ||
|
||
#include <vector> | ||
|
||
#include "tachyon/zk/plonk/circuit/table_base.h" | ||
|
||
namespace tachyon::zk { | ||
|
||
template <typename PolyOrEvals> | ||
class RefTable : public TableBase<PolyOrEvals> { | ||
public: | ||
RefTable() = default; | ||
RefTable(absl::Span<const PolyOrEvals> fixed_columns, | ||
absl::Span<const PolyOrEvals> advice_columns, | ||
absl::Span<const PolyOrEvals> instance_columns) | ||
: fixed_columns_(fixed_columns), | ||
advice_columns_(advice_columns), | ||
instance_columns_(instance_columns) {} | ||
|
||
absl::Span<const PolyOrEvals> fixed_columns() const override { | ||
return fixed_columns_; | ||
} | ||
absl::Span<const PolyOrEvals> advice_columns() const override { | ||
return advice_columns_; | ||
} | ||
absl::Span<const PolyOrEvals> instance_columns() const override { | ||
return instance_columns_; | ||
} | ||
|
||
protected: | ||
absl::Span<const PolyOrEvals> fixed_columns_; | ||
absl::Span<const PolyOrEvals> advice_columns_; | ||
absl::Span<const PolyOrEvals> instance_columns_; | ||
}; | ||
|
||
} // namespace tachyon::zk | ||
|
||
#endif // TACHYON_ZK_PLONK_CIRCUIT_REF_TABLE_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
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.