20 #include <ripple/basics/Buffer.h>
21 #include <ripple/basics/contract.h>
22 #include <ripple/beast/utility/rngfill.h>
23 #include <ripple/crypto/RFC1751.h>
24 #include <ripple/crypto/csprng.h>
25 #include <ripple/crypto/secure_erase.h>
26 #include <ripple/protocol/AccountID.h>
27 #include <ripple/protocol/PublicKey.h>
28 #include <ripple/protocol/SecretKey.h>
29 #include <ripple/protocol/Seed.h>
30 #include <ripple/protocol/digest.h>
72 h(passPhrase.
data(), passPhrase.
size());
84 if (result.size() != 16)
95 if (parseBase58<AccountID>(str) ||
111 if (
auto seed = parseBase58<Seed>(str))
std::size_t size() const noexcept
Returns the number of bytes in the storage.
T reverse_copy(T... args)
std::enable_if_t< std::is_same< T, char >::value||std::is_same< T, unsigned char >::value, Slice > makeSlice(std::array< T, N > const &a)
Returns the SHA512-Half digest of a message.
An immutable linear range of bytes.
T back_inserter(T... args)
csprng_engine & crypto_prng()
The default cryptographically secure PRNG.
std::uint8_t const * data() const noexcept
Return a pointer to beginning of the storage.
std::string decodeBase58Token(std::string const &s, TokenType type)
Decode a token of given type encoded using Base58Check and the XRPL alphabet.
static int getKeyFromEnglish(std::string &strKey, std::string const &strHuman)
Convert words separated by spaces into a 128 bit key in big-endian format.
constexpr static std::size_t size()
static Hasher::result_type digest(void const *data, std::size_t size) noexcept
Integers of any length that is a multiple of 32-bits.
std::string seedAs1751(Seed const &seed)
Encode a Seed in RFC1751 format.
Seed randomSeed()
Create a seed using secure random numbers.
std::optional< Seed > parseGenericSeed(std::string const &str, bool rfc1751)
Attempt to parse a string as a seed.
std::array< uint8_t, 16 > buf_
static void getEnglishFromKey(std::string &strHuman, std::string const &strKey)
Convert to human from a 128 bit key in big-endian format.
Seed generateSeed(std::string const &passPhrase)
Generate a seed deterministically.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Seeds are used to generate deterministic secret keys.
void rngfill(void *buffer, std::size_t bytes, Generator &g)
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
std::optional< AccountID > parseBase58(std::string const &s)
Parse AccountID from checked, base58 string.
void secure_erase(void *dest, std::size_t bytes)
Attempts to clear the given blob of memory.
std::uint8_t const * data() const