20 #include <ripple/protocol/Seed.h>
21 #include <ripple/basics/Buffer.h>
22 #include <ripple/protocol/AccountID.h>
23 #include <ripple/protocol/PublicKey.h>
24 #include <ripple/protocol/SecretKey.h>
25 #include <ripple/protocol/digest.h>
26 #include <ripple/basics/contract.h>
27 #include <ripple/crypto/RFC1751.h>
28 #include <ripple/crypto/csprng.h>
29 #include <ripple/beast/crypto/secure_erase.h>
30 #include <ripple/beast/utility/rngfill.h>
77 h(passPhrase.
data(), passPhrase.
size());
90 if (result.size() != 16)
101 if (parseBase58<AccountID>(str) ||
117 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.
static int getKeyFromEnglish(std::string &strKey, std::string const &strHuman)
Convert words seperated 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
std::string seedAs1751(Seed const &seed)
Encode a Seed in RFC1751 format.
Seed randomSeed()
Create a seed using secure random numbers.
boost::optional< Seed > parseGenericSeed(std::string const &str)
Attempt to parse a string as a seed.
void secure_erase(void *dest, std::size_t bytes)
Guaranteed to fill memory with zeroes.
std::array< uint8_t, 16 > buf_
bool SetHexExact(const char *psz)
Parse a hex string into a base_uint The string must contain exactly bytes * 2 hex characters and must...
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)
static std::string decodeBase58Token(std::string const &s, TokenType type, InverseArray const &inv)
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
boost::optional< AccountID > parseBase58(std::string const &s)
Parse AccountID from checked, base58 string.
std::uint8_t const * data() const