Offline Transaction Signing (OTS) 0.1.0
|
General functionality. More...
#include <ots.hpp>
Public Member Functions | |
OTS () | |
Static Public Member Functions | |
static const std::string | version () noexcept |
static std::array< int, 3 > | versionComponents () noexcept |
static uint64_t | heightFromTimestamp (uint64_t timestamp, Network network=Network::MAIN) |
Estimates the block height of a given timestamp. | |
static uint64_t | timestampFromHeight (uint64_t height, Network network=Network::MAIN) |
Estimates the timestamp for a given block height on a network. | |
static std::array< unsigned char, 32 > | random () |
Random 32 bytes. | |
static void | random (size_t size, uint8_t *bytes) |
Random bytes. | |
static bool | lowEntropy (size_t size, const uint8_t *data, double minEntropy=3.5) noexcept |
check for low entropy in data | |
static void | enforceEntropy (bool enforce=true) noexcept |
switch enforcement of sufficient entropy | |
static void | setMaxAccountDepth (uint32_t depth) noexcept |
set the maximum depth of the accounts to search through | |
static void | setMaxIndexDepth (uint32_t depth) noexcept |
set the maximum depth of the indexes to search through | |
static void | setMaxDepth (uint32_t account, uint32_t index) noexcept |
set the maximum depth of the accounts and indexes to search through | |
static void | resetMaxDepth () noexcept |
reset the maximum depth of the accounts and indexes to search through | |
static uint32_t | maxAccountDepth (uint32_t depth=0) noexcept |
get the maximum depth of the accounts to search through (lookahead, generate addresses to search) | |
static uint32_t | maxIndexDepth (uint32_t depth=0) noexcept |
get the maximum depth of the indexes to search through (lookahead, generate addresses to search) | |
static bool | verifyData (const std::string &data, const std::string &address, const std::string &signature, bool legacyFallback=false) |
Verify a signed message. | |
Static Protected Member Functions | |
static void | ensureEntropy (size_t size, const uint8_t *data, double minEntropy=3.5) |
check for low entropy in data | |
General functionality.
|
explicit |
|
staticnoexcept |
switch enforcement of sufficient entropy
enforce | true to enforce entropy check, default is true |
|
staticprotected |
check for low entropy in data
size | size of data |
data | the data to check |
minEntropy | the minimum entropy to accept |
ots::exception::LowEntropy | if the entropy is lower than minEntropy |
|
static |
Estimates the block height of a given timestamp.
timestamp | unix timestamp (epoch, seconds since 1970-01-01 00:00:00 UTC) |
network | estimation is network related |
|
staticnoexcept |
check for low entropy in data
size | size of data |
data | the data to check |
minEntropy | the minimum entropy to accept |
|
staticnoexcept |
get the maximum depth of the accounts to search through (lookahead, generate addresses to search)
depth | the maximum depth of the account, default is 0 and returns the current value, or DEFAULT_MAX_ACCOUNT_DEPTH or the value set via |
|
staticnoexcept |
get the maximum depth of the indexes to search through (lookahead, generate addresses to search)
depth | the maximum depth of the index, default is 0 and returns the current value, or DEFAULT_MAX_INDEX_DEPTH or the value set via |
|
static |
Random 32 bytes.
|
static |
Random bytes.
[IN] | size size of bytes |
[OUT] | bytes where to write the random bytes |
|
staticnoexcept |
reset the maximum depth of the accounts and indexes to search through
|
staticnoexcept |
set the maximum depth of the accounts to search through
depth | the maximum depth of the account, set this value to 0 will restrict to use only the main (wallet) account |
|
staticnoexcept |
set the maximum depth of the accounts and indexes to search through
account | the maximum depth of the account, set this value to 0 will restrict to use only the main (wallet) account |
index | the maximum depth of the index, set this value to 0 will restrict to use only the first index of every account |
|
staticnoexcept |
set the maximum depth of the indexes to search through
depth | the maximum depth of the index, set this value to 0 will restrict to use only the first index of every account |
|
static |
Estimates the timestamp for a given block height on a network.
height | monero blockchain block height |
network | estimation is network related |
|
static |
Verify a signed message.
data | String of the message to sign |
address | public Monero address as string |
signature | for the message |
legacyFallback | if true, will try to verify with legacy signature |
ots::exception::address::Invalid | if the address is not valid |
|
staticnoexcept |
|
staticnoexcept |