OpenCore  1.0.4
OpenCore Bootloader
Loading...
Searching...
No Matches
OcRngInternals.h
Go to the documentation of this file.
1
15#ifndef OC_RNG_INTERNALS_H
16#define OC_RNG_INTERNALS_H
17
18#include <Library/OcCryptoLib.h>
19
28UINT64
29EFIAPI
31 IN UINT64 Value
32 );
33
34//
35// Limited retry number when valid random data is returned.
36// Uses the recommended value defined in Section 7.3.17 of "Intel 64 and IA-32
37// Architectures Software Developer's Mannual".
38//
39#define RDRAND_RETRY_LIMIT 10
40
41//
42// Maximum amount of bytes emitted by PRNG before next reseed.
43//
44#define MAX_BYTES_TO_EMIT 1600000
45
46//
47// Maximum bytes in one buffer.
48//
49#define MAX_BYTES_IN_BUF (16*64)
50
54typedef struct OC_RNG_CONTEXT_ {
55 //
56 // Hardware random number generator available.
57 //
59 //
60 // Done initialising pseudo random number generator.
61 //
63 //
64 // Amount of bytes to emit before next reseed.
65 //
67 //
68 // Amount of bytes in the current buffer.
69 //
71 //
72 // Current CPRNG buffer.
73 //
75 //
76 // ChaCha context.
77 //
80
81#endif // OC_RNG_INTERNALS_H
UINT64 EFIAPI AsmAddRngJitter(IN UINT64 Value)
struct OC_RNG_CONTEXT_ OC_RNG_CONTEXT
#define MAX_BYTES_IN_BUF
BOOLEAN HardwareRngAvailable
BOOLEAN PrngInitialised
CHACHA_CONTEXT ChaCha
UINT8 Buffer[MAX_BYTES_IN_BUF]