diff --git a/lib/std/crypto/aes/aesni.zig b/lib/std/crypto/aes/aesni.zig index 13b3f8e52785ac2fd7ccdae21f07a549ab66f72b..1d719af9c7a0e7da1d1c3b703852de675b5351cc 100644 --- a/lib/std/crypto/aes/aesni.zig +++ b/lib/std/crypto/aes/aesni.zig @@ -313,10 +313,7 @@ pub fn AesEncryptCtx(comptime Aes: type) type { inline while (i < rounds) : (i += 1) { ts = Block.parallel.encryptWide(count, ts, round_keys[i]); } - i = 1; - inline while (i < count) : (i += 1) { - ts = Block.parallel.encryptLastWide(count, ts, round_keys[i]); - } + ts = Block.parallel.encryptLastWide(count, ts, round_keys[i]); j = 0; inline while (j < count) : (j += 1) { dst[16 * j .. 16 * j + 16].* = ts[j].toBytes(); @@ -392,10 +389,7 @@ pub fn AesDecryptCtx(comptime Aes: type) type { inline while (i < rounds) : (i += 1) { ts = Block.parallel.decryptWide(count, ts, inv_round_keys[i]); } - i = 1; - inline while (i < count) : (i += 1) { - ts = Block.parallel.decryptLastWide(count, ts, inv_round_keys[i]); - } + ts = Block.parallel.decryptLastWide(count, ts, inv_round_keys[i]); j = 0; inline while (j < count) : (j += 1) { dst[16 * j .. 16 * j + 16].* = ts[j].toBytes(); diff --git a/lib/std/crypto/aes/armcrypto.zig b/lib/std/crypto/aes/armcrypto.zig index d331783284f111da018c5e3afbc4e4b7e482bda2..85578fcad9773303b9f57cf3de39cc881e2455f4 100644 --- a/lib/std/crypto/aes/armcrypto.zig +++ b/lib/std/crypto/aes/armcrypto.zig @@ -364,10 +364,7 @@ pub fn AesEncryptCtx(comptime Aes: type) type { inline while (i < rounds) : (i += 1) { ts = Block.parallel.encryptWide(count, ts, round_keys[i]); } - i = 1; - inline while (i < count) : (i += 1) { - ts = Block.parallel.encryptLastWide(count, ts, round_keys[i]); - } + ts = Block.parallel.encryptLastWide(count, ts, round_keys[i]); j = 0; inline while (j < count) : (j += 1) { dst[16 * j .. 16 * j + 16].* = ts[j].toBytes(); @@ -443,10 +440,7 @@ pub fn AesDecryptCtx(comptime Aes: type) type { inline while (i < rounds) : (i += 1) { ts = Block.parallel.decryptWide(count, ts, inv_round_keys[i]); } - i = 1; - inline while (i < count) : (i += 1) { - ts = Block.parallel.decryptLastWide(count, ts, inv_round_keys[i]); - } + ts = Block.parallel.decryptLastWide(count, ts, inv_round_keys[i]); j = 0; inline while (j < count) : (j += 1) { dst[16 * j .. 16 * j + 16].* = ts[j].toBytes();