rippled
Loading...
Searching...
No Matches
tests/libxrpl/crypto/csprng.cpp
1#include <xrpl/crypto/csprng.h>
2
3#include <doctest/doctest.h>
4
5using namespace ripple;
6
7TEST_CASE("get values")
8{
9 auto& engine = crypto_prng();
10 auto rand_val = engine();
11 CHECK(rand_val >= engine.min());
12 CHECK(rand_val <= engine.max());
13 uint16_t twoByte{0};
14 engine(&twoByte, sizeof(uint16_t));
15}
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
csprng_engine & crypto_prng()
The default cryptographically secure PRNG.