4 * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5 * See included license file for license details.
7 #if !defined(_Random_h_)
14 * This class is from the crypto++ library.
16 class MicrosoftCryptoProvider
19 MicrosoftCryptoProvider();
20 ~MicrosoftCryptoProvider();
22 typedef unsigned __int64 ProviderHandle; // type HCRYPTPROV, avoid #include <windows.h>
24 typedef unsigned long ProviderHandle;
26 ProviderHandle GetProviderHandle() const {return m_hProvider;}
28 ProviderHandle m_hProvider;
31 #pragma comment(lib, "advapi32.lib")
35 * Encapsulates the Windows CryptoAPI's CryptGenRandom or /dev/urandom on Unix systems.
37 class RandomNumberGenerator
40 RandomNumberGenerator();
41 ~RandomNumberGenerator();
43 uint8_t generateByte();
44 void generateBlock(uint8_t * output, unsigned count);
48 # ifndef WORKAROUND_MS_BUG_Q258000
49 MicrosoftCryptoProvider m_provider;