From 4720b5ac21163936fb47f524037a6f12ce6e6ce2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 22 Jul 2026 18:31:50 +0200 Subject: rewrite: the beginning This a giant fuck-you to myself while I have nothing (actually, tons of things) to do in a hospital. * The giant screens of preprocessor code are gone, they always sucked, fuck them. * Switched everything to the "boxes" interface as the only one remaining. * Restuctured things in aes/ so that the files they're in make at least a little bit of sense. * Removed a bunch of cruft and prematurely generic code. * This is half-baked at best: I just made sure that the tests pass. A lot of cleanup awaits. --- aes/src/asm/aes128.asm | 16 ++++++++-------- aes/src/asm/aes192.asm | 16 ++++++++-------- aes/src/asm/aes256.asm | 16 ++++++++-------- 3 files changed, 24 insertions(+), 24 deletions(-) (limited to 'aes/src/asm') diff --git a/aes/src/asm/aes128.asm b/aes/src/asm/aes128.asm index abf5063..67498fd 100644 --- a/aes/src/asm/aes128.asm +++ b/aes/src/asm/aes128.asm @@ -9,7 +9,7 @@ .code -@aes128_encrypt_block_@20 proc +@aes128_encrypt_block_internal@20 proc pxor xmm0, [ecx] aesenc xmm0, [ecx + 10h] aesenc xmm0, [ecx + 20h] @@ -22,9 +22,9 @@ aesenc xmm0, [ecx + 90h] aesenclast xmm0, [ecx + 0A0h] ret -@aes128_encrypt_block_@20 endp +@aes128_encrypt_block_internal@20 endp -@aes128_decrypt_block_@20 proc +@aes128_decrypt_block_internal@20 proc pxor xmm0, [ecx] aesdec xmm0, [ecx + 10h] aesdec xmm0, [ecx + 20h] @@ -37,9 +37,9 @@ aesdec xmm0, [ecx + 90h] aesdeclast xmm0, [ecx + 0A0h] ret -@aes128_decrypt_block_@20 endp +@aes128_decrypt_block_internal@20 endp -@aes128_expand_key_@20 proc +@aes128_expand_key_internal@20 proc ; A "word" (in terms of the FIPS 187 standard) is a 32-bit block. ; Words are denoted by `w[N]`. ; @@ -166,9 +166,9 @@ aes128_keygen_assist: add ecx, 10h ; ecx = &w[i+8] ret -@aes128_expand_key_@20 endp +@aes128_expand_key_internal@20 endp -@aes128_derive_decryption_keys_@8 proc +@aes128_derive_decryption_keys_internal@8 proc movdqa xmm5, [ecx] movdqa xmm4, [ecx + 0A0h] movdqa [edx], xmm4 @@ -198,6 +198,6 @@ aes128_keygen_assist: movdqa [edx + 50h], xmm5 ret -@aes128_derive_decryption_keys_@8 endp +@aes128_derive_decryption_keys_internal@8 endp end diff --git a/aes/src/asm/aes192.asm b/aes/src/asm/aes192.asm index 5411419..765152c 100644 --- a/aes/src/asm/aes192.asm +++ b/aes/src/asm/aes192.asm @@ -9,7 +9,7 @@ .code -@aes192_encrypt_block_@20 proc +@aes192_encrypt_block_internal@20 proc pxor xmm0, [ecx] aesenc xmm0, [ecx + 10h] aesenc xmm0, [ecx + 20h] @@ -24,9 +24,9 @@ aesenc xmm0, [ecx + 0B0h] aesenclast xmm0, [ecx + 0C0h] ret -@aes192_encrypt_block_@20 endp +@aes192_encrypt_block_internal@20 endp -@aes192_decrypt_block_@20 proc +@aes192_decrypt_block_internal@20 proc pxor xmm0, [ecx] aesdec xmm0, [ecx + 10h] aesdec xmm0, [ecx + 20h] @@ -41,9 +41,9 @@ aesdec xmm0, [ecx + 0B0h] aesdeclast xmm0, [ecx + 0C0h] ret -@aes192_decrypt_block_@20 endp +@aes192_decrypt_block_internal@20 endp -@aes192_expand_key_@36 proc +@aes192_expand_key_internal@36 proc ; A "word" (in terms of the FIPS 187 standard) is a 32-bit block. ; Words are denoted by `w[N]`. ; @@ -207,9 +207,9 @@ aes192_keygen_assist: ; xmm1[31:0] == w[i+10] == RotWord(SubWord(w[i+5]))^Rcon^w[i+4]^w[i+3]^w[i+2]^w[i+1]^w[i] ret -@aes192_expand_key_@36 endp +@aes192_expand_key_internal@36 endp -@aes192_derive_decryption_keys_@8 proc +@aes192_derive_decryption_keys_internal@8 proc movdqa xmm5, [ecx] movdqa xmm4, [ecx + 0C0h] movdqa [edx], xmm4 @@ -244,6 +244,6 @@ aes192_keygen_assist: movdqa [edx + 60h], xmm5 ret -@aes192_derive_decryption_keys_@8 endp +@aes192_derive_decryption_keys_internal@8 endp end diff --git a/aes/src/asm/aes256.asm b/aes/src/asm/aes256.asm index 4c6c07c..58aad6b 100644 --- a/aes/src/asm/aes256.asm +++ b/aes/src/asm/aes256.asm @@ -9,7 +9,7 @@ .code -@aes256_encrypt_block_@20 proc +@aes256_encrypt_block_internal@20 proc pxor xmm0, [ecx] aesenc xmm0, [ecx + 10h] aesenc xmm0, [ecx + 20h] @@ -26,9 +26,9 @@ aesenc xmm0, [ecx + 0D0h] aesenclast xmm0, [ecx + 0E0h] ret -@aes256_encrypt_block_@20 endp +@aes256_encrypt_block_internal@20 endp -@aes256_decrypt_block_@20 proc +@aes256_decrypt_block_internal@20 proc pxor xmm0, [ecx] aesdec xmm0, [ecx + 10h] aesdec xmm0, [ecx + 20h] @@ -45,9 +45,9 @@ aesdec xmm0, [ecx + 0D0h] aesdeclast xmm0, [ecx + 0E0h] ret -@aes256_decrypt_block_@20 endp +@aes256_decrypt_block_internal@20 endp -@aes256_expand_key_@36 proc +@aes256_expand_key_internal@36 proc ; A "word" (in terms of the FIPS 187 standard) is a 32-bit block. ; Words are denoted by `w[N]`. ; @@ -240,9 +240,9 @@ aes256_keygen_assist: pxor xmm0, xmm1 ret -@aes256_expand_key_@36 endp +@aes256_expand_key_internal@36 endp -@aes256_derive_decryption_keys_@8 proc +@aes256_derive_decryption_keys_internal@8 proc movdqa xmm5, [ecx] movdqa xmm4, [ecx + 0E0h] movdqa [edx], xmm4 @@ -282,6 +282,6 @@ aes256_keygen_assist: movdqa [edx + 70h], xmm5 ret -@aes256_derive_decryption_keys_@8 endp +@aes256_derive_decryption_keys_internal@8 endp end -- cgit v1.3