Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Another attempt at recover_key
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Aug 3, 2021
1 parent d03838d commit 722eae5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions programs/eosio-tester/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1059,11 +1059,11 @@ struct callbacks {
std::memcpy(hash_val, hash.data(), hash.data_size());
}

int32_t recover_key( const void* digest_span,
int32_t recover_key( span<const char> digest_span,
span<const char> sig,
void* pub ) {
fc::sha256 digest;
std::memcpy(digest.data(), digest_span, digest.data_size());
std::memcpy(digest.data(), digest_span.data(), digest.data_size());

fc::crypto::signature s;
fc::datastream<const char*> ds( sig.data(), sig.size() );
Expand All @@ -1084,7 +1084,6 @@ struct callbacks {
if (static_cast<unsigned>(s.which()) >= eosio::chain::config::genesis_num_supported_key_types ) {
// EOS_ASSERT(pub.size() >= 33, eosio::chain::wasm_execution_error,
// "destination buffer must at least be able to hold an ECC public key");
check_bounds(pub, static_cast<size_t>(33));

auto packed_pubkey = fc::raw::pack(recovered);
auto copy_size = packed_pubkey.size();
Expand Down

0 comments on commit 722eae5

Please sign in to comment.