aboutsummaryrefslogtreecommitdiff
path: root/crypto/aes
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2026-04-07 22:35:35 +0000
committerEnji Cooper <ngie@FreeBSD.org>2026-04-07 22:35:35 +0000
commitab5fc4ac933ff67bc800e774dffce15e2a541e90 (patch)
tree41fac85d3f2f7d74be9bfce46b1a78ff9897165d /crypto/aes
parent808413da28df9fb93e1f304e6016b15e660f54c8 (diff)
Diffstat (limited to 'crypto/aes')
-rw-r--r--crypto/aes/asm/aes-riscv32-zkn.pl7
-rw-r--r--crypto/aes/asm/aes-riscv64-zkn.pl7
-rw-r--r--crypto/aes/asm/aes-riscv64-zvkned.pl13
-rw-r--r--crypto/aes/asm/aes-riscv64.pl10
4 files changed, 9 insertions, 28 deletions
diff --git a/crypto/aes/asm/aes-riscv32-zkn.pl b/crypto/aes/asm/aes-riscv32-zkn.pl
index 6fac45184620..ed8f4a7f83aa 100644
--- a/crypto/aes/asm/aes-riscv32-zkn.pl
+++ b/crypto/aes/asm/aes-riscv32-zkn.pl
@@ -2,7 +2,7 @@
# This file is dual-licensed, meaning that you can use it under your
# choice of either of the following two licenses:
#
-# Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You can obtain
# a copy in the file LICENSE in the source distribution or at
@@ -704,11 +704,6 @@ sub AES_set_common {
my ($ke128, $ke192, $ke256) = @_;
my $ret = '';
$ret .= <<___;
- bnez $UKEY,1f # if (!userKey || !key) return -1;
- bnez $KEYP,1f
- li a0,-1
- ret
-1:
# Determine number of rounds from key size in bits
li $T0,128
bne $BITS,$T0,1f
diff --git a/crypto/aes/asm/aes-riscv64-zkn.pl b/crypto/aes/asm/aes-riscv64-zkn.pl
index 0e8a1540c438..68c213e43e34 100644
--- a/crypto/aes/asm/aes-riscv64-zkn.pl
+++ b/crypto/aes/asm/aes-riscv64-zkn.pl
@@ -2,7 +2,7 @@
# This file is dual-licensed, meaning that you can use it under your
# choice of either of the following two licenses:
#
-# Copyright 2022-2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You can obtain
# a copy in the file LICENSE in the source distribution or at
@@ -392,11 +392,6 @@ sub AES_set_common {
my ($ke128, $ke192, $ke256) = @_;
my $ret = '';
$ret .= <<___;
- bnez $UKEY,1f # if (!userKey || !key) return -1;
- bnez $KEYP,1f
- li a0,-1
- ret
-1:
# Determine number of rounds from key size in bits
li $T0,128
bne $BITS,$T0,1f
diff --git a/crypto/aes/asm/aes-riscv64-zvkned.pl b/crypto/aes/asm/aes-riscv64-zvkned.pl
index 4c0292781d9f..014fa6807d33 100644
--- a/crypto/aes/asm/aes-riscv64-zvkned.pl
+++ b/crypto/aes/asm/aes-riscv64-zvkned.pl
@@ -2,7 +2,7 @@
# This file is dual-licensed, meaning that you can use it under your
# choice of either of the following two licenses:
#
-# Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2023-2026 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You can obtain
# a copy in the file LICENSE in the source distribution or at
@@ -828,9 +828,6 @@ $code .= <<___;
.globl rv64i_zvkned_set_encrypt_key
.type rv64i_zvkned_set_encrypt_key,\@function
rv64i_zvkned_set_encrypt_key:
- beqz $UKEY, L_fail_m1
- beqz $KEYP, L_fail_m1
-
# Get proper routine for key size
li $T0, 256
beq $BITS, $T0, L_set_key_256
@@ -847,9 +844,6 @@ $code .= <<___;
.globl rv64i_zvkned_set_decrypt_key
.type rv64i_zvkned_set_decrypt_key,\@function
rv64i_zvkned_set_decrypt_key:
- beqz $UKEY, L_fail_m1
- beqz $KEYP, L_fail_m1
-
# Get proper routine for key size
li $T0, 256
beq $BITS, $T0, L_set_key_256
@@ -1356,11 +1350,6 @@ ___
}
$code .= <<___;
-L_fail_m1:
- li a0, -1
- ret
-.size L_fail_m1,.-L_fail_m1
-
L_fail_m2:
li a0, -2
ret
diff --git a/crypto/aes/asm/aes-riscv64.pl b/crypto/aes/asm/aes-riscv64.pl
index 525eba4b4638..4bf9edae6858 100644
--- a/crypto/aes/asm/aes-riscv64.pl
+++ b/crypto/aes/asm/aes-riscv64.pl
@@ -1,5 +1,5 @@
#! /usr/bin/env perl
-# Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2022-2026 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
@@ -773,11 +773,13 @@ AES_set_encrypt_key:
___
$code .= save_regs();
$code .= <<___;
- bnez $UKEY,1f # if (!userKey || !key) return -1;
- bnez $KEYP,1f
+ beqz $UKEY,1f # if (!userKey || !key) return -1;
+ beqz $KEYP,1f
+ j 2f
+1:
li a0,-1
ret
-1:
+2:
la $RCON,AES_rcon
la $TBL,AES_Te0
li $T8,128