File tree Expand file tree Collapse file tree 5 files changed +106
-1
lines changed Expand file tree Collapse file tree 5 files changed +106
-1
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,9 @@ add_subdirectory(codec)
11
11
add_subdirectory (common )
12
12
add_subdirectory (crypto )
13
13
add_subdirectory (primitives )
14
+ add_subdirectory (proofs )
15
+ add_subdirectory (sectorbuilder )
14
16
add_subdirectory (storage )
15
17
add_subdirectory (fslock )
16
18
add_subdirectory (power )
17
19
add_subdirectory (vm )
18
- add_subdirectory (proofs )
Original file line number Diff line number Diff line change
1
+ #
2
+ # Copyright Soramitsu Co., Ltd. All Rights Reserved.
3
+ # SPDX-License-Identifier: Apache-2.0
4
+ #
5
+
6
+ add_library (proof_verifier
7
+ impl/proof_verifier_impl.cpp
8
+ )
9
+
10
+ target_link_libraries (proof_verifier
11
+ outcome
12
+ sector
13
+ proofs
14
+ )
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Copyright Soramitsu Co., Ltd. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ #include " sectorbuilder/impl/proof_verifier_impl.hpp"
7
+
8
+ #include " proofs/proofs.hpp"
9
+
10
+ namespace fc ::sectorbuilder {
11
+
12
+ outcome::result<bool > ProofVerifierImpl::verifySeal (
13
+ const primitives::sector::SealVerifyInfo &info) const {
14
+ return proofs::Proofs::verifySeal (info);
15
+ }
16
+
17
+ outcome::result<bool > ProofVerifierImpl::verifyElectionPost (
18
+ const primitives::sector::PoStVerifyInfo &info) const {
19
+ return verifyPost (info);
20
+ }
21
+
22
+ outcome::result<bool > ProofVerifierImpl::verifyFallbackPost (
23
+ const primitives::sector::PoStVerifyInfo &info) const {
24
+ return verifyPost (info);
25
+ }
26
+
27
+ outcome::result<bool > ProofVerifierImpl::verifyPost (
28
+ primitives::sector::PoStVerifyInfo info) const {
29
+ info.randomness [31 ] = 0 ;
30
+
31
+ return proofs::Proofs::verifyPoSt (info);
32
+ }
33
+ } // namespace fc::sectorbuilder
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Copyright Soramitsu Co., Ltd. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ #ifndef CPP_FILECOIN_CORE_PROOF_VERIFIER_IMPL_HPP
7
+ #define CPP_FILECOIN_CORE_PROOF_VERIFIER_IMPL_HPP
8
+
9
+ #include " sectorbuilder/proof_verifier.hpp"
10
+
11
+ namespace fc ::sectorbuilder {
12
+ class ProofVerifierImpl : public ProofVerifier {
13
+ public:
14
+ outcome::result<bool > verifySeal (
15
+ const primitives::sector::SealVerifyInfo &info) const override ;
16
+
17
+ outcome::result<bool > verifyElectionPost (
18
+ const primitives::sector::PoStVerifyInfo &info) const override ;
19
+
20
+ outcome::result<bool > verifyFallbackPost (
21
+ const primitives::sector::PoStVerifyInfo &info) const override ;
22
+
23
+ private:
24
+ outcome::result<bool > verifyPost (
25
+ primitives::sector::PoStVerifyInfo info) const ;
26
+ };
27
+
28
+ } // namespace fc::sectorbuilder
29
+
30
+ #endif // CPP_FILECOIN_CORE_PROOF_VERIFIER_IMPL_HPP
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * Copyright Soramitsu Co., Ltd. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+
6
+ #ifndef CPP_FILECOIN_CORE_PROOF_VERIFIER_HPP
7
+ #define CPP_FILECOIN_CORE_PROOF_VERIFIER_HPP
8
+
9
+ #include " primitives/sector/sector.hpp"
10
+
11
+ namespace fc ::sectorbuilder {
12
+ class ProofVerifier {
13
+ public:
14
+ virtual ~ProofVerifier () = default ;
15
+
16
+ virtual outcome::result<bool > verifySeal (
17
+ const primitives::sector::SealVerifyInfo &info) const = 0;
18
+
19
+ virtual outcome::result<bool > verifyElectionPost (
20
+ const primitives::sector::PoStVerifyInfo &info) const = 0;
21
+
22
+ virtual outcome::result<bool > verifyFallbackPost (
23
+ const primitives::sector::PoStVerifyInfo &info) const = 0;
24
+ };
25
+ } // namespace fc::sectorbuilder
26
+
27
+ #endif // CPP_FILECOIN_CORE_PROOF_VERIFIER_HPP
You can’t perform that action at this time.
0 commit comments