Skip to content

Commit

Permalink
Seed ROSC random using rstate_lfsr
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Feb 12, 2025
1 parent d07f6e1 commit 8b7b2bf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions enc_bootloader/aes.S
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pointer is overwritten.
#include "hardware/regs/clocks.h"
#include "hardware/regs/sha256.h"
#include "hardware/regs/resets.h"
#include "hardware/regs/rosc.h"
#include "hardware/regs/trng.h"
#include "hardware/rcp.h"

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

0 comments on commit 8b7b2bf

Please sign in to comment.