From ac7f44b1b863afac1b2ed91a4de28f9855dfa222 Mon Sep 17 00:00:00 2001 From: Yawning Angel Date: Fri, 2 Aug 2024 02:40:04 +0900 Subject: [PATCH] core/crypto/aes: Slightly tweak GHASH to look less spooky --- core/crypto/_aes/ct64/ghash.odin | 2 +- core/crypto/_aes/hw_intel/ghash.odin | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/crypto/_aes/ct64/ghash.odin b/core/crypto/_aes/ct64/ghash.odin index 21ac2ca97..a522a481a 100644 --- a/core/crypto/_aes/ct64/ghash.odin +++ b/core/crypto/_aes/ct64/ghash.odin @@ -80,8 +80,8 @@ ghash :: proc "contextless" (dst, key, data: []byte) { h2 := h0 ~ h1 h2r := h0r ~ h1r - src: []byte for l > 0 { + src: []byte = --- if l >= _aes.GHASH_BLOCK_SIZE { src = buf buf = buf[_aes.GHASH_BLOCK_SIZE:] diff --git a/core/crypto/_aes/hw_intel/ghash.odin b/core/crypto/_aes/hw_intel/ghash.odin index 39351393f..d61e71b3a 100644 --- a/core/crypto/_aes/hw_intel/ghash.odin +++ b/core/crypto/_aes/hw_intel/ghash.odin @@ -240,8 +240,8 @@ ghash :: proc "contextless" (dst, key, data: []byte) #no_bounds_check { } // Process 1 block at a time - src: []byte for l > 0 { + src: []byte = --- if l >= _aes.GHASH_BLOCK_SIZE { src = buf buf = buf[_aes.GHASH_BLOCK_SIZE:]