Gitiles
Code Review
Sign In
gerrit.openbmc.org
/
openbmc
/
phosphor-net-ipmid
/
refs/heads/master
/
.
/
prng.hpp
blob: 95946f7974c0dfa2ff0c29408eb09ea54a9c1592 [
file
] [
log
] [
blame
]
Vernon Mauery
8977d12
2018-10-24 14:02:16 -0700
[
diff
] [
blame
]
1
#include
<openssl/rand.h>
2
3
namespace
crypto
4
{
5
6
struct
prng
7
{
8
static
unsigned
int
rand
()
9
{
10
unsigned
int
v
;
11
RAND_bytes
(
reinterpret_cast
<
unsigned
char
*>(&
v
),
sizeof
(
v
));
12
return
v
;
13
}
14
};
15
16
}
// namespace crypto