Kinetis Bootloader Host  2.0.0
Host Tools for Kinetis devices
src/blfwk/Random.h
1 /*
2  * File: Random.h
3  *
4  * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5  * See included license file for license details.
6  */
7 #if !defined(_Random_h_)
8 #define _Random_h_
9 
10 #include "stdafx.h"
11 
12 #ifdef WIN32
13 
17 {
18 public:
21 #if defined(_WIN64)
22  typedef unsigned __int64 ProviderHandle; // type HCRYPTPROV, avoid #include <windows.h>
23 #else
24  typedef unsigned long ProviderHandle;
25 #endif
26  ProviderHandle GetProviderHandle() const { return m_hProvider; }
27 private:
28  ProviderHandle m_hProvider;
29 };
30 
31 #pragma comment(lib, "advapi32.lib")
32 #endif // WIN32
33 
38 {
39 public:
42 
43  uint8_t generateByte();
44  void generateBlock(uint8_t *output, unsigned count);
45 
46 protected:
47 #ifdef WIN32
48 #ifndef WORKAROUND_MS_BUG_Q258000
49  MicrosoftCryptoProvider m_provider;
50 #endif
51 #else // WIN32
52  int m_fd;
53 #endif // WIN32
54 };
55 
56 #endif // _Random_h_
Definition: apps/elftosb/common/Random.h:16
Definition: apps/elftosb/common/Random.h:37