[PATCH 0/3] lib/crypto: FIPS self-tests for AES encryption modes

Eric Biggers posted 3 patches 2 months ago
lib/crypto/aes.c                    | 259 ++++++++++++++++++++++++++--
lib/crypto/fips-aes.h               |  78 +++++++++
lib/crypto/{fips.h => fips-sha.h}   |   6 +-
lib/crypto/sha1.c                   |   2 +-
lib/crypto/sha256.c                 |   2 +-
lib/crypto/sha3.c                   |   2 +-
lib/crypto/sha512.c                 |   2 +-
scripts/crypto/gen-fips-testvecs.py | 164 ++++++++++++++----
8 files changed, 459 insertions(+), 56 deletions(-)
create mode 100644 lib/crypto/fips-aes.h
rename lib/crypto/{fips.h => fips-sha.h} (90%)
[PATCH 0/3] lib/crypto: FIPS self-tests for AES encryption modes
Posted by Eric Biggers 2 months ago
Add FIPS self-tests for all the FIPS-approved AES modes implemented in
aes.c.  These are needed to exercise the inverse direction of the block
cipher, and to prepare for the planned integration of
architecture-optimized implementations of individual modes.

Eric Biggers (3):
  lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.h
  lib/crypto: aes: Add FIPS self-tests for unauthenticated modes
  lib/crypto: aes: Add FIPS self-tests for GCM and CCM

 lib/crypto/aes.c                    | 259 ++++++++++++++++++++++++++--
 lib/crypto/fips-aes.h               |  78 +++++++++
 lib/crypto/{fips.h => fips-sha.h}   |   6 +-
 lib/crypto/sha1.c                   |   2 +-
 lib/crypto/sha256.c                 |   2 +-
 lib/crypto/sha3.c                   |   2 +-
 lib/crypto/sha512.c                 |   2 +-
 scripts/crypto/gen-fips-testvecs.py | 164 ++++++++++++++----
 8 files changed, 459 insertions(+), 56 deletions(-)
 create mode 100644 lib/crypto/fips-aes.h
 rename lib/crypto/{fips.h => fips-sha.h} (90%)


base-commit: 6d22ec26295c1412d765e3d687e46224fc332928
-- 
2.55.0
Re: [PATCH 0/3] lib/crypto: FIPS self-tests for AES encryption modes
Posted by Eric Biggers 1 month, 3 weeks ago
On Sun, Aug 02, 2026 at 03:24:05PM -0700, Eric Biggers wrote:
> Add FIPS self-tests for all the FIPS-approved AES modes implemented in
> aes.c.  These are needed to exercise the inverse direction of the block
> cipher, and to prepare for the planned integration of
> architecture-optimized implementations of individual modes.
> 
> Eric Biggers (3):
>   lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.h
>   lib/crypto: aes: Add FIPS self-tests for unauthenticated modes
>   lib/crypto: aes: Add FIPS self-tests for GCM and CCM
> 
>  lib/crypto/aes.c                    | 259 ++++++++++++++++++++++++++--
>  lib/crypto/fips-aes.h               |  78 +++++++++
>  lib/crypto/{fips.h => fips-sha.h}   |   6 +-
>  lib/crypto/sha1.c                   |   2 +-
>  lib/crypto/sha256.c                 |   2 +-
>  lib/crypto/sha3.c                   |   2 +-
>  lib/crypto/sha512.c                 |   2 +-
>  scripts/crypto/gen-fips-testvecs.py | 164 ++++++++++++++----
>  8 files changed, 459 insertions(+), 56 deletions(-)
>  create mode 100644 lib/crypto/fips-aes.h
>  rename lib/crypto/{fips.h => fips-sha.h} (90%)

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/log/?h=libcrypto-next

- Eric
Re: [PATCH 0/3] lib/crypto: FIPS self-tests for AES encryption modes
Posted by Ard Biesheuvel 1 month, 4 weeks ago

On Mon, 3 Aug 2026, at 01:24, Eric Biggers wrote:
> Add FIPS self-tests for all the FIPS-approved AES modes implemented in
> aes.c.  These are needed to exercise the inverse direction of the block
> cipher, and to prepare for the planned integration of
> architecture-optimized implementations of individual modes.
>
> Eric Biggers (3):
>   lib/crypto: fips: Split fips.h into fips-aes.h and fips-sha.h
>   lib/crypto: aes: Add FIPS self-tests for unauthenticated modes
>   lib/crypto: aes: Add FIPS self-tests for GCM and CCM
>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>