From b4c525695a3c90fc1dc7bbffbcfb51d57ccab96f Mon Sep 17 00:00:00 2001 From: dehanj Date: Wed, 12 Jun 2024 15:12:09 +0200 Subject: [PATCH] Remove redundant RAM address and data scrambling The RAM address and data scrambling API was called twice, once before filling RAM with random values, and once after. Since moving to a significantly better PRNG (xorwow) this is now deemed unnecessary. See issue #225. This changes both FPGA and firmware hashes. --- hw/application_fpga/application_fpga.bin.sha256 | 2 +- hw/application_fpga/firmware.bin.sha512 | 2 +- hw/application_fpga/fw/tk1/main.c | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/application_fpga/application_fpga.bin.sha256 b/hw/application_fpga/application_fpga.bin.sha256 index 38da834..fb36dd1 100644 --- a/hw/application_fpga/application_fpga.bin.sha256 +++ b/hw/application_fpga/application_fpga.bin.sha256 @@ -1 +1 @@ -c0da9e30042b87e0acbb01c9faf135b604f3f3b8cc1c7f7cc426d926bba785c1 application_fpga.bin +809eedf8a582b2b985292ea35102b6dd23c501202ea1c9c3b13dfdb4ff934e8e application_fpga.bin diff --git a/hw/application_fpga/firmware.bin.sha512 b/hw/application_fpga/firmware.bin.sha512 index 1763d72..c5e51a0 100644 --- a/hw/application_fpga/firmware.bin.sha512 +++ b/hw/application_fpga/firmware.bin.sha512 @@ -1 +1 @@ -d14bc9d8366505bc6f3312991d49ce7fe07d472fc936f4fabde4bf7d8775bde576268c79579d60f83e79de173a4217e00ecb1e04178db621cf9f332315485a73 firmware.bin +edb39fca7dafb8ea0b89fdeecd960d7656e14ce461e49af97160a8bd6e67d9987e816adad37ba0fcfa63d107c3160988e4c3423ce4a71c39544bc0045888fec1 firmware.bin diff --git a/hw/application_fpga/fw/tk1/main.c b/hw/application_fpga/fw/tk1/main.c index b696c9d..70e29c2 100644 --- a/hw/application_fpga/fw/tk1/main.c +++ b/hw/application_fpga/fw/tk1/main.c @@ -377,10 +377,6 @@ static void scramble_ram(void) { uint32_t *ram = (uint32_t *)(TK1_RAM_BASE); - // Set RAM address and data scrambling values - *ram_rand = rnd_word(); - *ram_scramble = rnd_word(); - // Fill RAM with random data // Get random state and accumulator seeds. uint32_t data_state = rnd_word(); @@ -391,8 +387,7 @@ static void scramble_ram(void) ram[w] = data_state; } - // Set new address and RAM scrambling values, - // for all use of RAM by app. + // Set RAM address and data scrambling parameters *ram_rand = rnd_word(); *ram_scramble = rnd_word(); }