aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2024-05-12 22:48:09 -0400
committerBoringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com>2024-05-23 17:50:36 +0000
commit03982b4cfadca0e650b384c9539b2fdb5f8aa012 (patch)
tree0f9bf918d0be79198d42c9d23f7d69aed7b09460 /crypto
parent273a920f84e8b0b258737cea0f2f24627e8c5ed9 (diff)
downloadboringssl-03982b4cfadca0e650b384c9539b2fdb5f8aa012.zip
boringssl-03982b4cfadca0e650b384c9539b2fdb5f8aa012.tar.gz
boringssl-03982b4cfadca0e650b384c9539b2fdb5f8aa012.tar.bz2
Don't bother checking for NULL pointers in AES key schedule assembly
Some of the AES implementations tried to cleanly check for NULL input and output pointers, but others did not, so callers could not rely on this. (If we end up needing to check this for some reason, we should do it in the C wrapper.) Change-Id: I495e5b3689837242b5c51bf01840997845190754 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68688 Reviewed-by: Bob Beck <bbe@google.com> Commit-Queue: David Benjamin <davidben@google.com>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/fipsmodule/aes/asm/aesni-x86.pl9
-rw-r--r--crypto/fipsmodule/aes/asm/aesni-x86_64.pl6
-rw-r--r--crypto/fipsmodule/aes/asm/aesv8-armx.pl5
3 files changed, 0 insertions, 20 deletions
diff --git a/crypto/fipsmodule/aes/asm/aesni-x86.pl b/crypto/fipsmodule/aes/asm/aesni-x86.pl
index 7d97adc..bb5ee94 100644
--- a/crypto/fipsmodule/aes/asm/aesni-x86.pl
+++ b/crypto/fipsmodule/aes/asm/aesni-x86.pl
@@ -2122,10 +2122,6 @@ if ($PREFIX eq $AESNI_PREFIX) {
&function_begin_B("_aesni_set_encrypt_key");
&push ("ebp");
&push ("ebx");
- &test ("eax","eax");
- &jz (&label("bad_pointer"));
- &test ($key,$key);
- &jz (&label("bad_pointer"));
&call (&label("pic"));
&set_label("pic");
@@ -2474,11 +2470,6 @@ if ($PREFIX eq $AESNI_PREFIX) {
&pop ("ebp");
&ret ();
-&set_label("bad_pointer",4);
- &mov ("eax",-1);
- &pop ("ebx");
- &pop ("ebp");
- &ret ();
&set_label("bad_keybits",4);
&pxor ("xmm0","xmm0");
&mov ("eax",-2);
diff --git a/crypto/fipsmodule/aes/asm/aesni-x86_64.pl b/crypto/fipsmodule/aes/asm/aesni-x86_64.pl
index 6a85862..17ec466 100644
--- a/crypto/fipsmodule/aes/asm/aesni-x86_64.pl
+++ b/crypto/fipsmodule/aes/asm/aesni-x86_64.pl
@@ -3275,12 +3275,6 @@ __aesni_set_encrypt_key:
.cfi_adjust_cfa_offset 8
.seh_stackalloc 8
.seh_endprologue
- mov \$-1,%rax
- test $inp,$inp
- jz .Lenc_key_ret
- test $key,$key
- jz .Lenc_key_ret
-
movups ($inp),%xmm0 # pull first 128 bits of *userKey
xorps %xmm4,%xmm4 # low dword of xmm4 is assumed 0
leaq OPENSSL_ia32cap_P(%rip),%r10
diff --git a/crypto/fipsmodule/aes/asm/aesv8-armx.pl b/crypto/fipsmodule/aes/asm/aesv8-armx.pl
index 9f62232..46b98c9 100644
--- a/crypto/fipsmodule/aes/asm/aesv8-armx.pl
+++ b/crypto/fipsmodule/aes/asm/aesv8-armx.pl
@@ -102,11 +102,6 @@ $code.=<<___ if ($flavour =~ /64/);
add x29,sp,#0
___
$code.=<<___;
- mov $ptr,#-1
- cmp $inp,#0
- b.eq .Lenc_key_abort
- cmp $out,#0
- b.eq .Lenc_key_abort
mov $ptr,#-2
cmp $bits,#128
b.lt .Lenc_key_abort