Alexander Afanasyev | e9fdb80 | 2014-02-05 17:36:51 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /** |
| 3 | * Copyright (C) 2014 Named Data Networking Project |
| 4 | * See COPYING for copyright and distribution information. |
| 5 | */ |
| 6 | |
| 7 | #include "random.hpp" |
| 8 | |
| 9 | #if __clang__ |
| 10 | #pragma clang diagnostic push |
| 11 | #pragma clang diagnostic ignored "-Wreorder" |
| 12 | #pragma clang diagnostic ignored "-Wtautological-compare" |
| 13 | #pragma clang diagnostic ignored "-Wunused-variable" |
| 14 | #pragma clang diagnostic ignored "-Wunused-function" |
| 15 | #elif __GNUC__ |
| 16 | #pragma GCC diagnostic ignored "-Wreorder" |
| 17 | #pragma GCC diagnostic ignored "-Wunused-variable" |
| 18 | #pragma GCC diagnostic ignored "-Wunused-function" |
| 19 | #endif |
| 20 | |
| 21 | #include <cryptopp/osrng.h> |
| 22 | |
| 23 | namespace ndn { |
| 24 | namespace random { |
| 25 | |
| 26 | uint32_t |
| 27 | generateWord32() |
| 28 | { |
| 29 | static CryptoPP::AutoSeededRandomPool rng; |
| 30 | |
| 31 | return rng.GenerateWord32(); |
| 32 | } |
| 33 | |
| 34 | } // namespace random |
| 35 | } // namespace ndn |