Skip to content

Commit

Permalink
Changed the default/testing mask to match intent.
Browse files Browse the repository at this point in the history
  • Loading branch information
Iluvmagick committed Jan 16, 2024
1 parent 4a1b9f4 commit dd012a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace nil {
}
};

template<typename TranscriptHashType, typename FieldType, std::uint64_t MASK=0x1FFFFFFFF0000000>
template<typename TranscriptHashType, typename FieldType, std::uint64_t MASK=0xFFFF800000000000>
class field_proof_of_work {
public:
using transcript_hash_type = TranscriptHashType;
Expand Down
4 changes: 2 additions & 2 deletions test/commitment/proof_of_work.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(pow_poseidon_basic_test) {
using integral_type = typename field_type::integral_type;
using policy = nil::crypto3::hashes::detail::mina_poseidon_policy<field_type>;
using poseidon = nil::crypto3::hashes::poseidon<policy>;
const std::uint64_t mask = 0x1F;
const std::uint64_t mask = 0xFF00000000000000;
using pow_type = nil::crypto3::zk::commitments::field_proof_of_work<poseidon, field_type, mask>;

nil::crypto3::zk::transcript::fiat_shamir_heuristic_sequential<poseidon> transcript;
Expand All @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(pow_poseidon_basic_test) {
integral_type int_mask = integral_type(mask) << (field_type::modulus_bits - 64);
BOOST_ASSERT((integral_type(chal.data) & int_mask) == 0);

using hard_pow_type = nil::crypto3::zk::commitments::field_proof_of_work<poseidon, field_type, 0x1FFFFFFFF>;
using hard_pow_type = nil::crypto3::zk::commitments::field_proof_of_work<poseidon, field_type, 0xFFFFFFFFF0000000>;
// check that random stuff doesn't pass verify
BOOST_ASSERT(!hard_pow_type::verify(old_transcript_1, result));
}
Expand Down

0 comments on commit dd012a0

Please sign in to comment.