Skip to content

Commit

Permalink
libsnark: update for libff (fix strange serialization issue)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtebbs committed Sep 5, 2019
1 parent 013d7a7 commit e19f110
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion depends/libsnark
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,8 @@ target_link_libraries(
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
)
target_link_libraries(
test_mpc
${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
)
21 changes: 21 additions & 0 deletions src/test/powersoftau_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,27 @@ TEST(PowersOfTauTests, ComputeLagrangeEvaluation)
}
}

TEST(PowersOfTauTests, SerializeG2)
{
const Fr fr_7(7);
const G2 g2_7 = fr_7 * G2::one();

std::cout << "g2_7: " << to_hex(g2_7) << std::endl;

// Serialize
std::ostringstream out;
out << g2_7;
std::string g2_7_ser = out.str();
std::cout << "g2_7_ser: " << bin_to_hex(g2_7_ser) << std::endl;

// Deserialize
std::istringstream in(g2_7_ser);
G2 g2_7_deser;
in >> g2_7_deser;

ASSERT_EQ(g2_7, g2_7_deser);
}

TEST(PowersOfTauTests, SerializeLagrangeEvaluation)
{
const size_t n = 16;
Expand Down

0 comments on commit e19f110

Please sign in to comment.