From c64d7904b47dc72002b610549cb0334ee78635b2 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 21 May 2018 13:07:46 -0600 Subject: [PATCH] Fusee: Fix se_calculate_sha256 --- fusee/fusee-secondary/src/se.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fusee/fusee-secondary/src/se.c b/fusee/fusee-secondary/src/se.c index eb0d9d80d..bf3a7cc92 100644 --- a/fusee/fusee-secondary/src/se.c +++ b/fusee/fusee-secondary/src/se.c @@ -542,13 +542,13 @@ void se_calculate_sha256(void *dst, const void *src, size_t src_size) { SECURITY_ENGINE->CONFIG_REG = (ENCMODE_SHA256 | ALG_SHA | DST_HASHREG); SECURITY_ENGINE->SHA_CONFIG_REG = 1; SECURITY_ENGINE->SHA_MSG_LENGTH_REG = (uint32_t)(src_size << 3); + SECURITY_ENGINE->_0x208 = 0; SECURITY_ENGINE->_0x20C = 0; SECURITY_ENGINE->_0x210 = 0; - SECURITY_ENGINE->SHA_MSG_LEFT_REG = 0; - SECURITY_ENGINE->_0x218 = (uint32_t)(src_size << 3); + SECURITY_ENGINE->SHA_MSG_LEFT_REG = (uint32_t)(src_size << 3); + SECURITY_ENGINE->_0x218 = 0; SECURITY_ENGINE->_0x21C = 0; SECURITY_ENGINE->_0x220 = 0; - SECURITY_ENGINE->_0x224 = 0; /* Trigger the operation. */ trigger_se_blocking_op(OP_START, NULL, 0, src, src_size);