rippled
Loading...
Searching...
No Matches
tests/libxrpl/crypto/csprng.cpp
1#include <xrpl/crypto/csprng.h>
2
3#include <gtest/gtest.h>
4
5using namespace xrpl;
6
7TEST(csprng, get_values)
8{
9 auto& engine = crypto_prng();
10 auto rand_val = engine();
11 EXPECT_GE(rand_val, engine.min());
12 EXPECT_LE(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:5
csprng_engine & crypto_prng()
The default cryptographically secure PRNG.