예제 #1
0
OctetString pbkdf2_hmac_hash(const std::string& password, const SecureVector& salt, int desiredKeyLength, int iterations)
{
    T hashObject;
    Botan::HMAC hmac(&hashObject);
    Botan::PKCS5_PBKDF2 pbkdf2(&hmac);
    return pbkdf2.derive_key(desiredKeyLength, password, salt.data(), salt.size(), iterations);
}
예제 #2
0
uint64_t Address::extract_stream_number(const std::string& address)
{
    if(!check::address(address))
        throw ParseException(__FILE__, __FUNCTION__, __LINE__, "Invalid address checksum");

    int nb;
    std::string addr = utils::remove_prefix(address, "BM-");
    SecureVector bytes = decode::base58(addr);

    decode::varint(bytes.data(), nb);
    return decode::varint(&bytes[nb], nb);
}