From 96f20287ff3113ed62bb47d52a57a2463364b6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Tue, 26 Apr 2022 21:30:14 +0200 Subject: [PATCH] fix scope error --- src/nrf52/aes-256/tiny-aes.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/nrf52/aes-256/tiny-aes.cpp b/src/nrf52/aes-256/tiny-aes.cpp index 256ae55d8..dc28a5249 100644 --- a/src/nrf52/aes-256/tiny-aes.cpp +++ b/src/nrf52/aes-256/tiny-aes.cpp @@ -53,16 +53,13 @@ static void KeyExpansion(uint8_t* RoundKey, const uint8_t* Key) RoundKey[(i * 4) + 3] = Key[(i * 4) + 3]; } - for (i = Nk; i < Nb * (Nr + 1); ++i) + for (unsigned i = Nk; i < Nb * (Nr + 1); ++i) { - { - unsigned k = (i - 1) * 4; - tempa[0]=RoundKey[k + 0]; - tempa[1]=RoundKey[k + 1]; - tempa[2]=RoundKey[k + 2]; - tempa[3]=RoundKey[k + 3]; - - } + unsigned k = (i - 1) * 4; + tempa[0]=RoundKey[k + 0]; + tempa[1]=RoundKey[k + 1]; + tempa[2]=RoundKey[k + 2]; + tempa[3]=RoundKey[k + 3]; if (i % Nk == 0) {