-
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.
feat(sp1): add rust binding for
TwoAdicFriPcs::Open()
- Loading branch information
Showing
17 changed files
with
503 additions
and
8 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,28 @@ | ||
#ifndef VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_FRI_PROOF_H_ | ||
#define VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_FRI_PROOF_H_ | ||
|
||
#include <memory> | ||
|
||
#include "rust/cxx.h" | ||
|
||
#include "tachyon/c/zk/air/sp1/baby_bear_poseidon2_fri_proof.h" | ||
|
||
namespace tachyon::sp1_api::baby_bear_poseidon2 { | ||
|
||
class FriProof { | ||
public: | ||
explicit FriProof(tachyon_sp1_baby_bear_poseidon2_fri_proof* proof) | ||
: proof_(proof) {} | ||
FriProof(const FriProof& other) = delete; | ||
FriProof& operator=(const FriProof& other) = delete; | ||
~FriProof(); | ||
|
||
std::unique_ptr<FriProof> clone() const; | ||
|
||
private: | ||
tachyon_sp1_baby_bear_poseidon2_fri_proof* proof_; | ||
}; | ||
|
||
} // namespace tachyon::sp1_api::baby_bear_poseidon2 | ||
|
||
#endif // VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_FRI_PROOF_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,41 @@ | ||
#ifndef VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_OPENING_POINTS_H_ | ||
#define VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_OPENING_POINTS_H_ | ||
|
||
#include <stddef.h> | ||
|
||
#include <memory> | ||
|
||
#include "tachyon/c/math/finite_fields/baby_bear/baby_bear4.h" | ||
#include "tachyon/c/zk/air/sp1/baby_bear_poseidon2_opening_points.h" | ||
|
||
namespace tachyon::sp1_api::baby_bear_poseidon2 { | ||
|
||
struct TachyonBabyBear4; | ||
|
||
class OpeningPoints { | ||
public: | ||
explicit OpeningPoints( | ||
tachyon_sp1_baby_bear_poseidon2_opening_points* opening_points) | ||
: opening_points_(opening_points) {} | ||
OpeningPoints(const OpeningPoints& other) = delete; | ||
OpeningPoints& operator=(const OpeningPoints& other) = delete; | ||
~OpeningPoints(); | ||
|
||
const tachyon_sp1_baby_bear_poseidon2_opening_points* opening_points() const { | ||
return opening_points_; | ||
} | ||
|
||
std::unique_ptr<OpeningPoints> clone() const; | ||
void allocate(size_t round, size_t rows, size_t cols); | ||
void set_point(size_t round, size_t row, size_t col, | ||
const TachyonBabyBear4& point); | ||
|
||
private: | ||
tachyon_sp1_baby_bear_poseidon2_opening_points* opening_points_ = nullptr; | ||
}; | ||
|
||
std::unique_ptr<OpeningPoints> new_opening_points(size_t rounds); | ||
|
||
} // namespace tachyon::sp1_api::baby_bear_poseidon2 | ||
|
||
#endif // VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_OPENING_POINTS_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,37 @@ | ||
#ifndef VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_OPENING_PROOF_H_ | ||
#define VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_OPENING_PROOF_H_ | ||
|
||
#include <memory> | ||
|
||
#include "rust/cxx.h" | ||
|
||
#include "tachyon/c/zk/air/sp1/baby_bear_poseidon2_fri_proof.h" | ||
#include "tachyon/c/zk/air/sp1/baby_bear_poseidon2_opened_values.h" | ||
|
||
namespace tachyon::sp1_api::baby_bear_poseidon2 { | ||
|
||
class FriProof; | ||
|
||
class OpeningProof { | ||
public: | ||
OpeningProof(); | ||
OpeningProof(const OpeningProof& other) = delete; | ||
OpeningProof& operator=(const OpeningProof& other) = delete; | ||
~OpeningProof(); | ||
|
||
tachyon_sp1_baby_bear_poseidon2_opened_values** opened_values_ptr() { | ||
return &opened_values_; | ||
} | ||
tachyon_sp1_baby_bear_poseidon2_fri_proof** proof_ptr() { return &proof_; } | ||
|
||
rust::Vec<uint8_t> serialize_to_opened_values() const; | ||
std::unique_ptr<FriProof> take_fri_proof(); | ||
|
||
private: | ||
tachyon_sp1_baby_bear_poseidon2_opened_values* opened_values_; | ||
tachyon_sp1_baby_bear_poseidon2_fri_proof* proof_; | ||
}; | ||
|
||
} // namespace tachyon::sp1_api::baby_bear_poseidon2 | ||
|
||
#endif // VENDORS_SP1_INCLUDE_BABY_BEAR_POSEIDON2_OPENING_PROOF_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.