diff --git a/wolfssl/internal.h b/wolfssl/internal.h index e9b7e8211..f67a39e21 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -1153,15 +1153,6 @@ enum Misc { SESSION_FLUSH_COUNT = 256, /* Flush session cache unless user turns off */ #ifdef HAVE_FIPS - /* these moved into wolfCrypt, but kept here for backwards compatibility with FIPS */ - DES_KEY_SIZE = 8, /* des */ - DES3_KEY_SIZE = 24, /* 3 des ede */ - DES_IV_SIZE = DES_BLOCK_SIZE, - AES_256_KEY_SIZE = 32, /* for 256 bit */ - AES_192_KEY_SIZE = 24, /* for 192 bit */ - AES_IV_SIZE = 16, /* always block size */ - AES_128_KEY_SIZE = 16, /* for 128 bit */ - MAX_SYM_KEY_SIZE = AES_256_KEY_SIZE, #else MAX_SYM_KEY_SIZE = WC_MAX_SYM_KEY_SIZE, diff --git a/wolfssl/wolfcrypt/aes.h b/wolfssl/wolfcrypt/aes.h index 5560b7ef0..d85635294 100644 --- a/wolfssl/wolfcrypt/aes.h +++ b/wolfssl/wolfcrypt/aes.h @@ -62,6 +62,16 @@ extern "C" { #endif +/* these are required for FIPS and non-FIPS */ +enum { + AES_128_KEY_SIZE = 16, /* for 128 bit */ + AES_192_KEY_SIZE = 24, /* for 192 bit */ + AES_256_KEY_SIZE = 32, /* for 256 bit */ + + AES_IV_SIZE = 16, /* always block size */ +}; + + #ifndef HAVE_FIPS /* to avoid redefinition of structures */ #ifdef WOLFSSL_ASYNC_CRYPT @@ -74,13 +84,8 @@ enum { AES_DECRYPTION = 1, AES_BLOCK_SIZE = 16, - AES_IV_SIZE = AES_BLOCK_SIZE, - - KEYWRAP_BLOCK_SIZE = 8, - AES_128_KEY_SIZE = 16, /* for 128 bit */ - AES_192_KEY_SIZE = 24, /* for 192 bit */ - AES_256_KEY_SIZE = 32, /* for 256 bit */ + KEYWRAP_BLOCK_SIZE = 8, }; diff --git a/wolfssl/wolfcrypt/des3.h b/wolfssl/wolfcrypt/des3.h index 00838a7a6..7d6297356 100644 --- a/wolfssl/wolfcrypt/des3.h +++ b/wolfssl/wolfcrypt/des3.h @@ -39,6 +39,14 @@ extern "C" { #endif +/* these are required for FIPS and non-FIPS */ +enum { + DES_KEY_SIZE = 8, /* des */ + DES3_KEY_SIZE = 24, /* 3 des ede */ + DES_IV_SIZE = 16, +}; + + #ifndef HAVE_FIPS /* to avoid redefinition of macros */ #ifdef WOLFSSL_ASYNC_CRYPT @@ -52,10 +60,6 @@ enum { DES_BLOCK_SIZE = 8, DES_KS_SIZE = 32, /* internal DES key buffer size */ - DES_KEY_SIZE = 8, /* des */ - DES3_KEY_SIZE = 24, /* 3 des ede */ - DES_IV_SIZE = DES_BLOCK_SIZE, - DES_ENCRYPTION = 0, DES_DECRYPTION = 1 };