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
28
UINT64
29
EFIAPI
30
AsmAddRngJitter
(
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
54
typedef
struct
OC_RNG_CONTEXT_
{
55
//
56
// Hardware random number generator available.
57
//
58
BOOLEAN
HardwareRngAvailable
;
59
//
60
// Done initialising pseudo random number generator.
61
//
62
BOOLEAN
PrngInitialised
;
63
//
64
// Amount of bytes to emit before next reseed.
65
//
66
UINT32
BytesTillReseed
;
67
//
68
// Amount of bytes in the current buffer.
69
//
70
UINT32
BytesInBuffer
;
71
//
72
// Current CPRNG buffer.
73
//
74
UINT8
Buffer
[
MAX_BYTES_IN_BUF
];
75
//
76
// ChaCha context.
77
//
78
CHACHA_CONTEXT
ChaCha
;
79
}
OC_RNG_CONTEXT
;
80
81
#endif
// OC_RNG_INTERNALS_H
OcCryptoLib.h
AsmAddRngJitter
UINT64 EFIAPI AsmAddRngJitter(IN UINT64 Value)
OC_RNG_CONTEXT
struct OC_RNG_CONTEXT_ OC_RNG_CONTEXT
MAX_BYTES_IN_BUF
#define MAX_BYTES_IN_BUF
Definition
OcRngInternals.h:49
CHACHA_CONTEXT_
Definition
OcCryptoLib.h:113
OC_RNG_CONTEXT_
Definition
OcRngInternals.h:54
OC_RNG_CONTEXT_::BytesInBuffer
UINT32 BytesInBuffer
Definition
OcRngInternals.h:70
OC_RNG_CONTEXT_::HardwareRngAvailable
BOOLEAN HardwareRngAvailable
Definition
OcRngInternals.h:58
OC_RNG_CONTEXT_::PrngInitialised
BOOLEAN PrngInitialised
Definition
OcRngInternals.h:62
OC_RNG_CONTEXT_::ChaCha
CHACHA_CONTEXT ChaCha
Definition
OcRngInternals.h:78
OC_RNG_CONTEXT_::Buffer
UINT8 Buffer[MAX_BYTES_IN_BUF]
Definition
OcRngInternals.h:74
OC_RNG_CONTEXT_::BytesTillReseed
UINT32 BytesTillReseed
Definition
OcRngInternals.h:66
Library
OcRngLib
OcRngInternals.h
Generated by
1.12.0