Skip to content

Commit

Permalink
GH-1523 CDT will use Affine little-endian format.
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Sep 5, 2023
1 parent f39b105 commit ab4c1eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ namespace webassembly {
* struct abi_finalizer_authority {
* std::string description;
* uint64_t fweight = 0; // weight that this finalizer's vote has for meeting fthreshold
* std::array<uint8_t, 144> public_key_g1_jacobian;
* std::array<uint8_t, 96> public_key_g1_affine_le;
* };
* struct abi_finalizer_set {
* uint64_t fthreshold = 0;
Expand Down
6 changes: 3 additions & 3 deletions libraries/chain/webassembly/privileged.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ namespace eosio { namespace chain { namespace webassembly {
struct abi_finalizer_authority {
std::string description;
uint64_t fweight = 0; // weight that this finalizer's vote has for meeting fthreshold
std::array<uint8_t, 144> public_key_g1_jacobian;
std::array<uint8_t, 96> public_key_g1_affine_le;
};
struct abi_finalizer_set {
uint64_t fthreshold = 0;
Expand All @@ -183,7 +183,7 @@ namespace eosio { namespace chain { namespace webassembly {
EOS_ASSERT( f.description.size() <= config::max_finalizer_description_size, wasm_execution_error,
"Finalizer description greater than ${s}", ("s", config::max_finalizer_description_size) );
f_weight_sum += f.fweight;
std::optional<bls12_381::g1> pk = bls12_381::g1::fromJacobianBytesLE(f.public_key_g1_jacobian);
std::optional<bls12_381::g1> pk = bls12_381::g1::fromAffineBytesLE(f.public_key_g1_affine_le);
EOS_ASSERT( pk, wasm_execution_error, "Invalid public key for: ${d}", ("d", f.description) );
finset.finalizers.push_back(finalizer_authority{.description = std::move(f.description),
.fweight = f.fweight,
Expand Down Expand Up @@ -272,5 +272,5 @@ namespace eosio { namespace chain { namespace webassembly {
}
}}} // ns eosio::chain::webassembly

FC_REFLECT(eosio::chain::webassembly::abi_finalizer_authority, (description)(fweight)(public_key_g1_jacobian));
FC_REFLECT(eosio::chain::webassembly::abi_finalizer_authority, (description)(fweight)(public_key_g1_affine_le));
FC_REFLECT(eosio::chain::webassembly::abi_finalizer_set, (fthreshold)(finalizers));

0 comments on commit ab4c1eb

Please sign in to comment.