1
0
Fork 0
mirror of https://github.com/eosswedenorg/libantelope synced 2026-06-17 20:10:03 +02:00

Adding src/wif/codec.hpp

This commit is contained in:
Henrik Hautakoski 2023-03-25 15:24:05 +01:00
parent ebb4219024
commit 3abfc488e8

52
src/wif/codec.hpp Normal file
View file

@ -0,0 +1,52 @@
/**
* MIT License
*
* Copyright (c) 2019-2021 EOS Sw/eden
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef LIBEOSIO_CODEC_H
#define LIBEOSIO_CODEC_H
#include <libeosio/WIF.hpp>
#include <vector>
namespace libeosio { namespace internal {
/**
* Public-key encoders
*/
typedef void (*pub_encoder_t)(const ec_pubkey_t& key, unsigned char *buf);
void pub_encoder_legacy(const ec_pubkey_t& key, unsigned char *buf);
void pub_encoder_k1(const ec_pubkey_t& key, unsigned char *buf);
/**
* Public-key decoders
*/
typedef bool (*pub_decoder_t)(const std::vector<unsigned char>& buf, ec_pubkey_t& key);
bool pub_decoder_legacy(const std::vector<unsigned char>& buf, ec_pubkey_t& key);
bool pub_decoder_k1(const std::vector<unsigned char>& buf, ec_pubkey_t& key);
}} // namespace libeosio::internal
#endif /* LIBEOSIO_CODEC_H */