xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
tests
libxrpl
crypto
tests/libxrpl/crypto/csprng.cpp
1
#include <xrpl/crypto/csprng.h>
2
3
#include <gtest/gtest.h>
4
5
#include <
cstdint
>
6
7
using namespace
xrpl
;
8
9
TEST
(Csprng, get_values)
10
{
11
auto
& engine =
cryptoPrng
();
12
auto
randVal = engine();
13
EXPECT_GE(randVal, engine.min());
14
EXPECT_LE(randVal, engine.max());
15
uint16_t twoByte{0};
16
engine(&twoByte,
sizeof
(uint16_t));
17
}
cstdint
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::TEST
TEST(FileUtilitiesTest, get_file_contents)
Definition
tests/libxrpl/basics/FileUtilities.cpp:60
xrpl::cryptoPrng
CsprngEngine & cryptoPrng()
The default cryptographically secure PRNG.
Definition
libxrpl/crypto/csprng.cpp:81
Generated by
1.17.0