Commit 7e4666a
committed
ESP-IDF: Enable by default and use
After reviewing the updated ESP-IDF random documentation:
- https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/random.html
- https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf#rng
I think we should enable this backend by default, and use their
`getrandom` bindings. Given that ESP-IDF provides such bindings, its
clear they intend for cryptographic libraries to use them. Furthurmore,
it seems like the only time the Hardware RNG would lack sufficient
entropy is during early boot, so I added a section to our "Early boot"
documentation noting this issue.
Also note that Rust's standard library unconditonally supports ESP-IDF
for both hash seed generation and generating cryptographic random bytes,
see https://github.com/rust-lang/rust/blob/62bf38fa600f4beb878d61c537837729d4ee689e/library/std/src/sys/random/espidf.rs#L7
Using the `getrandom` binding ensures that if ESP-IDF ever improves
their implementation, we will immediately be able to take advantage of
it.
Signed-off-by: Joe Richey <[email protected]>getrandom
1 parent 9fb4a9a commit 7e4666a
File tree
6 files changed
+16
-43
lines changed- .github/workflows
- src
- backends
6 files changed
+16
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | 211 | | |
224 | 212 | | |
225 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
68 | 69 | | |
69 | 70 | | |
70 | 71 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
84 | | - | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
250 | 257 | | |
251 | 258 | | |
252 | 259 | | |
| |||
335 | 342 | | |
336 | 343 | | |
337 | 344 | | |
338 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
339 | 348 | | |
340 | 349 | | |
341 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | 25 | | |
29 | 26 | | |
30 | 27 | | |
| |||
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
| 46 | + | |
49 | 47 | | |
50 | 48 | | |
51 | 49 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
0 commit comments