Skip to content

Commit 8b7b2bf

Browse files
committed
Seed ROSC random using rstate_lfsr
1 parent d07f6e1 commit 8b7b2bf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

enc_bootloader/aes.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pointer is overwritten.
1818
#include "hardware/regs/clocks.h"
1919
#include "hardware/regs/sha256.h"
2020
#include "hardware/regs/resets.h"
21+
#include "hardware/regs/rosc.h"
2122
#include "hardware/regs/trng.h"
2223
#include "hardware/rcp.h"
2324

@@ -291,6 +292,8 @@ init_rstate:
291292
mov r1,r5 @ give up and use the address of rstate_sha (which is non-zero); this can't really happen (2^{-96} probability)
292293
1:
293294
str r1,[r5,#rstate_lfsr-rstate_sha]
295+
ldr r2,=ROSC_RANDOM_OFFSET+ROSC_BASE
296+
str r1,[r2,#0]
294297
CHK_COUNT 27,6
295298
.if GEN_RAND_SHA
296299
.if SH_JITTER

0 commit comments

Comments
 (0)