mirror of
https://github.com/eosswedenorg/libantelope
synced 2026-08-26 13:38:12 +02:00
src/wif/k1.cpp: in _checksum_suffix() change array to std::vector as MSVC does not like variable size c-arrays.
This commit is contained in:
parent
9819b2b94d
commit
815ab2569f
1 changed files with 5 additions and 4 deletions
|
|
@ -23,6 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <libeosio/checksum.hpp>
|
#include <libeosio/checksum.hpp>
|
||||||
|
#include <vector>
|
||||||
#include "codec.hpp"
|
#include "codec.hpp"
|
||||||
|
|
||||||
namespace libeosio { namespace internal {
|
namespace libeosio { namespace internal {
|
||||||
|
|
@ -33,12 +34,12 @@ namespace libeosio { namespace internal {
|
||||||
//
|
//
|
||||||
// Should implement and use Init/Update/Finalize hash functions to do it inplace.
|
// Should implement and use Init/Update/Finalize hash functions to do it inplace.
|
||||||
checksum_t _checksum_suffix(const unsigned char *in, size_t size, const char *suffix) {
|
checksum_t _checksum_suffix(const unsigned char *in, size_t size, const char *suffix) {
|
||||||
unsigned char buf[size + 2];
|
std::vector<unsigned char> buf(size + 2);
|
||||||
|
|
||||||
memcpy(buf, in, size);
|
memcpy(buf.data(), in, size);
|
||||||
memcpy(buf + size, suffix, 2);
|
memcpy(buf.data() + size, suffix, 2);
|
||||||
|
|
||||||
return checksum_ripemd160(buf, size + 2);
|
return checksum_ripemd160(buf.data(), buf.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void pub_encoder_k1(const ec_pubkey_t& key, unsigned char *buf) {
|
void pub_encoder_k1(const ec_pubkey_t& key, unsigned char *buf) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue