Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed bls private, public key / signature encoding from base58 to base64 #1587

Merged
merged 2 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions libraries/libfc/include/fc/crypto/bls_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,35 @@
namespace fc::crypto::blslib {

template <typename Container>
static Container serialize_base58(const std::string& data_str)
static Container deserialize_base64(const std::string& data_str)
{

using wrapper = checksummed_data<Container>;

wrapper wrapped;

auto bin = fc::from_base58(data_str);
auto bin = fc::base64_decode(data_str);
fc::datastream<const char*> unpacker(bin.data(), bin.size());
fc::raw::unpack(unpacker, wrapped);
FC_ASSERT(!unpacker.remaining(), "decoded base58 length too long");
FC_ASSERT(!unpacker.remaining(), "decoded base64 length too long");
auto checksum = wrapper::calculate_checksum(wrapped.data, nullptr);
FC_ASSERT(checksum == wrapped.check);

return wrapped.data;
}

template <typename Container>
static std::string deserialize_base58( Container data, const yield_function_t& yield) {
static std::string serialize_base64( Container data) {

using wrapper = checksummed_data<Container>;

wrapper wrapped;

wrapped.data = data;
yield();
wrapped.check = wrapper::calculate_checksum(wrapped.data, nullptr);
yield();
auto packed = raw::pack( wrapped );
yield();
auto data_str = to_base58( packed.data(), packed.size(), yield );
yield();

auto data_str = fc::base64_encode( packed.data(), packed.size());

return data_str;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/libfc/include/fc/crypto/bls_private_key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace fc::crypto::blslib {
explicit bls_private_key(const std::vector<uint8_t>& seed ) {
_sk = bls12_381::secret_key(seed);
}
explicit bls_private_key(const std::string& base58str);
explicit bls_private_key(const std::string& base64str);

bls_private_key& operator=( const bls_private_key& ) = default;

Expand Down
2 changes: 1 addition & 1 deletion libraries/libfc/include/fc/crypto/bls_public_key.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace fc::crypto::blslib {
bls_public_key( bls_public_key&& ) = default;
bls_public_key( const bls_public_key& ) = default;
explicit bls_public_key( const bls12_381::g1& pkey ) {_pkey = pkey;}
explicit bls_public_key(const std::string& base58str);
explicit bls_public_key(const std::string& base64str);

bls_public_key& operator=(const bls_public_key&) = default;
std::string to_string(const yield_function_t& yield = yield_function_t()) const;
Expand Down
2 changes: 1 addition & 1 deletion libraries/libfc/include/fc/crypto/bls_signature.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace fc::crypto::blslib {
bls_signature( bls_signature&& ) = default;
bls_signature( const bls_signature& ) = default;
explicit bls_signature( const bls12_381::g2& sig ){_sig = sig;}
explicit bls_signature(const std::string& base58str);
explicit bls_signature(const std::string& base64str);

bls_signature& operator= (const bls_signature& ) = default;
std::string to_string(const yield_function_t& yield = yield_function_t()) const;
Expand Down
16 changes: 8 additions & 8 deletions libraries/libfc/src/crypto/bls_private_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,26 @@ namespace fc::crypto::blslib {
return bls_private_key(v);
}

static std::array<uint64_t, 4> priv_parse_base58(const std::string& base58str)
static std::array<uint64_t, 4> priv_parse_base64(const std::string& base64str)
{
auto res = std::mismatch(config::bls_private_key_prefix.begin(), config::bls_private_key_prefix.end(),
base58str.begin());
FC_ASSERT(res.first == config::bls_private_key_prefix.end(), "BLS Private Key has invalid format : ${str}", ("str", base58str));
base64str.begin());
FC_ASSERT(res.first == config::bls_private_key_prefix.end(), "BLS Private Key has invalid format : ${str}", ("str", base64str));

auto data_str = base58str.substr(config::bls_private_key_prefix.size());
auto data_str = base64str.substr(config::bls_private_key_prefix.size());

std::array<uint64_t, 4> bytes = fc::crypto::blslib::serialize_base58<std::array<uint64_t, 4>>(data_str);
std::array<uint64_t, 4> bytes = fc::crypto::blslib::deserialize_base64<std::array<uint64_t, 4>>(data_str);

return bytes;
}

bls_private_key::bls_private_key(const std::string& base58str)
:_sk(priv_parse_base58(base58str))
bls_private_key::bls_private_key(const std::string& base64str)
:_sk(priv_parse_base64(base64str))
{}

std::string bls_private_key::to_string(const yield_function_t& yield) const
{
std::string data_str = fc::crypto::blslib::deserialize_base58<std::array<uint64_t, 4>>(_sk, yield);
std::string data_str = fc::crypto::blslib::serialize_base64<std::array<uint64_t, 4>>(_sk);

return config::bls_private_key_prefix + data_str;
}
Expand Down
16 changes: 8 additions & 8 deletions libraries/libfc/src/crypto/bls_public_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@

namespace fc::crypto::blslib {

static bls12_381::g1 pub_parse_base58(const std::string& base58str)
static bls12_381::g1 pub_parse_base64(const std::string& base64str)
{
auto res = std::mismatch(config::bls_public_key_prefix.begin(), config::bls_public_key_prefix.end(),
base58str.begin());
FC_ASSERT(res.first == config::bls_public_key_prefix.end(), "BLS Public Key has invalid format : ${str}", ("str", base58str));
base64str.begin());
FC_ASSERT(res.first == config::bls_public_key_prefix.end(), "BLS Public Key has invalid format : ${str}", ("str", base64str));

auto data_str = base58str.substr(config::bls_public_key_prefix.size());
auto data_str = base64str.substr(config::bls_public_key_prefix.size());

std::array<uint8_t, 48> bytes = fc::crypto::blslib::serialize_base58<std::array<uint8_t, 48>>(data_str);
std::array<uint8_t, 48> bytes = fc::crypto::blslib::deserialize_base64<std::array<uint8_t, 48>>(data_str);

std::optional<bls12_381::g1> g1 = bls12_381::g1::fromCompressedBytesBE(bytes);
FC_ASSERT(g1);
return *g1;
}

bls_public_key::bls_public_key(const std::string& base58str)
:_pkey(pub_parse_base58(base58str))
bls_public_key::bls_public_key(const std::string& base64str)
:_pkey(pub_parse_base64(base64str))
{}

std::string bls_public_key::to_string(const yield_function_t& yield)const {

std::array<uint8_t, 48> bytes = _pkey.toCompressedBytesBE();

std::string data_str = fc::crypto::blslib::deserialize_base58<std::array<uint8_t, 48>>(bytes, yield);
std::string data_str = fc::crypto::blslib::serialize_base64<std::array<uint8_t, 48>>(bytes);

return config::bls_public_key_prefix + data_str;

Expand Down
18 changes: 9 additions & 9 deletions libraries/libfc/src/crypto/bls_signature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@

namespace fc::crypto::blslib {

static bls12_381::g2 sig_parse_base58(const std::string& base58str)
static bls12_381::g2 sig_parse_base64(const std::string& base64str)
{
try {

auto res = std::mismatch(config::bls_signature_prefix.begin(), config::bls_signature_prefix.end(),
base58str.begin());
FC_ASSERT(res.first == config::bls_signature_prefix.end(), "BLS Signature has invalid format : ${str}", ("str", base58str));
base64str.begin());
FC_ASSERT(res.first == config::bls_signature_prefix.end(), "BLS Signature has invalid format : ${str}", ("str", base64str));

auto data_str = base58str.substr(config::bls_signature_prefix.size());
auto data_str = base64str.substr(config::bls_signature_prefix.size());

std::array<uint8_t, 96> bytes = fc::crypto::blslib::serialize_base58<std::array<uint8_t, 96>>(data_str);
std::array<uint8_t, 96> bytes = fc::crypto::blslib::deserialize_base64<std::array<uint8_t, 96>>(data_str);

std::optional<bls12_381::g2> g2 = bls12_381::g2::fromCompressedBytesBE(bytes);
FC_ASSERT(g2);
return *g2;

} FC_RETHROW_EXCEPTIONS( warn, "error parsing bls_signature", ("str", base58str ) )
} FC_RETHROW_EXCEPTIONS( warn, "error parsing bls_signature", ("str", base64str ) )
}

bls_signature::bls_signature(const std::string& base58str)
:_sig(sig_parse_base58(base58str))
bls_signature::bls_signature(const std::string& base64str)
:_sig(sig_parse_base64(base64str))
{}

std::string bls_signature::to_string(const yield_function_t& yield) const
{

std::array<uint8_t, 96> bytes = _sig.toCompressedBytesBE();

std::string data_str = fc::crypto::blslib::deserialize_base58<std::array<uint8_t, 96>>(bytes, yield);
std::string data_str = fc::crypto::blslib::serialize_base64<std::array<uint8_t, 96>>(bytes);

return config::bls_signature_prefix + data_str;

Expand Down
60 changes: 30 additions & 30 deletions libraries/libfc/test/test_bls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,48 +280,48 @@ BOOST_AUTO_TEST_CASE(bls_binary_keys_encoding_check) try {
BOOST_AUTO_TEST_CASE(bls_prefix_encoding_check) try {

//test no_throw for correctly encoded keys
BOOST_CHECK_NO_THROW(bls_private_key("PVT_BLS_M6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcG"));
BOOST_CHECK_NO_THROW(bls_public_key("PUB_BLS_ZCYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"));
BOOST_CHECK_NO_THROW(bls_signature("SIG_BLS_7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"));
BOOST_CHECK_NO_THROW(bls_private_key("PVT_BLS_LaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+x"));
BOOST_CHECK_NO_THROW(bls_public_key("PUB_BLS_hiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="));
BOOST_CHECK_NO_THROW(bls_signature("SIG_BLS_qn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="));

//test no pivot delimiter
BOOST_CHECK_THROW(bls_private_key("PVTBLSM6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcG"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUBBLSZCYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("SIGBLS7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("PVTBLSLaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+x"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUBBLShiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("SIGBLSqn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="), fc::assert_exception);

//test first prefix validation
BOOST_CHECK_THROW(bls_private_key("XYZ_BLS_M6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcG"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("XYZ_BLS_ZCYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("XYZ_BLS_7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("XYZ_BLS_LaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+x"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("XYZ_BLS_hiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("XYZ_BLS_qn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="), fc::assert_exception);

//test second prefix validation
BOOST_CHECK_THROW(bls_private_key("PVT_XYZ_M6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcG"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_XYZ_ZCYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("SIG_XYZ_7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("PVT_XYZ_LaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+x"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_XYZ_hiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("SIG_XYZ_qn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="), fc::assert_exception);

//test missing prefix
BOOST_CHECK_THROW(bls_private_key("M6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcG"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("ZCYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("LaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+x"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("hiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("qn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="), fc::assert_exception);

//test incomplete prefix
BOOST_CHECK_THROW(bls_private_key("PVT_M6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcG"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_ZCYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("PUB_7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("BLS_M6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcG"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("BLS_ZCYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("BLS_7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("PVT_LaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+x"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_hiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("SIG_qn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("BLS_LaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+x"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("BLS_hiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("BLS_qn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="), fc::assert_exception);

//test invalid data / invalid checksum
BOOST_CHECK_THROW(bls_private_key("PVT_BLS_M6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcH"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_BLS_ZCYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsv"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("PUB_BLS_7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3p"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("PVT_BLS_N6m7EUvzEbQErhkKUrsA96VGpdM3R3MTDszXnywcwPCt3XAcG"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_BLS_ACYDaAqkbBChfXcFaa6QKvy3eiGuHtF3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("PUB_BLS_6dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHuf1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("PVT_BLS_M6m7EUvzEbQErhkKUrsA96VGqdM3R3MTDszXnywcwPCt3XAcG"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_BLS_ZCYDaAqkbBChfXcFaa6QKvy3eiGuHtE3oZ9qJUqedttU9xQFESheHMjw1wEzFTXfoJaTHsu"), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("PUB_BLS_7dJV81MchymhckRBjZzJGPq5hySbAMrvhhWpvAou86YjhbpMuTm2RTcij1kxHug1M1ew3PW3dVxKv8LZxntYF5c7S7TsoemqmJmnUUyGUpd8Pvs58eDREExQoHE5q2PZwaXiPVN3o"), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("PVT_BLS_LaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+y"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_BLS_hiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFBA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("SIG_BLS_qn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS8g=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("PVT_BLS_LaNRcYuQxSm/tRrMofQduPb5U2xUfdrCO0Yo5/CRcDeeHO+x"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_BLS_hiQykLvL/ZrnW97OeYGWU1AgjrXpnwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("SIG_BLS_qn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqQ8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_private_key("PVT_BLS_MaNRcYuQxSm/tRrMofQduPa5U2xUfdrCO0Yo5/CRcDeeHO+x"), fc::assert_exception);
BOOST_CHECK_THROW(bls_public_key("PUB_BLS_iiQykLvL/ZrnW97OeYGWU1AgjrXpmwTVzSTpVa2pYfjAoWLe50C+e9xsPAYTui6xbEYFCA=="), fc::assert_exception);
BOOST_CHECK_THROW(bls_signature("SIG_BLS_rn0BzfxSR4D6TK5c0MCYkX/hG4hp7NPwkEHvws4zoToZgPatfhqP8A62sEZd9gQ4FB95uVAQX04ZDj7nx85fsUdv4RtW6fxzUV2ZudfNUWRdjPX8ytXXnMEBAs6RRoF1TfiS9g=="), fc::assert_exception);

} FC_LOG_AND_RETHROW();

Expand Down