From e45867bbc31ad3a43c958a636d417c5c5b61de62 Mon Sep 17 00:00:00 2001 From: kaleb-himes Date: Thu, 4 Apr 2024 14:45:20 -0400 Subject: [PATCH] WIN fips section refactor / wolfEntropy API syntax adjustment --- wolfcrypt/src/aes.c | 4 ++-- wolfcrypt/src/aes_asm.asm | 4 ++-- wolfcrypt/src/cmac.c | 4 ++-- wolfcrypt/src/des3.c | 4 ++-- wolfcrypt/src/dh.c | 4 ++-- wolfcrypt/src/ed25519.c | 4 ++-- wolfcrypt/src/ed448.c | 4 ++-- wolfcrypt/src/hmac.c | 4 ++-- wolfcrypt/src/kdf.c | 4 ++-- wolfcrypt/src/port/kcapi/kcapi_aes.c | 4 ++-- wolfcrypt/src/pwdbased.c | 4 ++-- wolfcrypt/src/random.c | 10 +++++----- wolfcrypt/src/rsa.c | 4 ++-- wolfcrypt/src/sha.c | 4 ++-- wolfcrypt/src/sha256.c | 4 ++-- wolfcrypt/src/sha3.c | 4 ++-- wolfcrypt/src/sha512.c | 4 ++-- 17 files changed, 37 insertions(+), 37 deletions(-) diff --git a/wolfcrypt/src/aes.c b/wolfcrypt/src/aes.c index 97a09baf7..8a4f21a48 100644 --- a/wolfcrypt/src/aes.c +++ b/wolfcrypt/src/aes.c @@ -44,8 +44,8 @@ block cipher mechanism that uses n-bit binary string parameter key with 128-bits #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$g") - #pragma const_seg(".fipsB$g") + #pragma code_seg(".fipsA$b") + #pragma const_seg(".fipsB$b") #endif #endif diff --git a/wolfcrypt/src/aes_asm.asm b/wolfcrypt/src/aes_asm.asm index 39d5fdc9b..1531748da 100644 --- a/wolfcrypt/src/aes_asm.asm +++ b/wolfcrypt/src/aes_asm.asm @@ -40,7 +40,7 @@ IFDEF HAVE_FIPS ENDIF IF fips_version GE 2 - fipsAh SEGMENT ALIAS(".fipsA$h") 'CODE' + fipsAbc SEGMENT ALIAS(".fipsA$bc") 'CODE' ELSE _text SEGMENT ENDIF @@ -1523,7 +1523,7 @@ MAKE_RK256_b: IF fips_version GE 2 - fipsAh ENDS + fipsAbc ENDS ELSE _text ENDS ENDIF diff --git a/wolfcrypt/src/cmac.c b/wolfcrypt/src/cmac.c index 473aea2ea..49ab1657c 100644 --- a/wolfcrypt/src/cmac.c +++ b/wolfcrypt/src/cmac.c @@ -39,8 +39,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$n") - #pragma const_seg(".fipsB$n") + #pragma code_seg(".fipsA$c") + #pragma const_seg(".fipsB$c") #endif #endif diff --git a/wolfcrypt/src/des3.c b/wolfcrypt/src/des3.c index 650c33a36..30f597386 100644 --- a/wolfcrypt/src/des3.c +++ b/wolfcrypt/src/des3.c @@ -38,8 +38,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$i") - #pragma const_seg(".fipsB$i") + #pragma code_seg(".fipsA$d") + #pragma const_seg(".fipsB$d") #endif #endif diff --git a/wolfcrypt/src/dh.c b/wolfcrypt/src/dh.c index ebccd93b4..041915998 100644 --- a/wolfcrypt/src/dh.c +++ b/wolfcrypt/src/dh.c @@ -35,8 +35,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$m") - #pragma const_seg(".fipsB$m") + #pragma code_seg(".fipsA$e") + #pragma const_seg(".fipsB$e") #endif #endif diff --git a/wolfcrypt/src/ed25519.c b/wolfcrypt/src/ed25519.c index baa9f8a45..e5572c377 100644 --- a/wolfcrypt/src/ed25519.c +++ b/wolfcrypt/src/ed25519.c @@ -41,8 +41,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$e") - #pragma const_seg(".fipsB$e") + #pragma code_seg(".fipsA$fa") + #pragma const_seg(".fipsB$fa") #endif #endif diff --git a/wolfcrypt/src/ed448.c b/wolfcrypt/src/ed448.c index 05651c788..2c746860a 100644 --- a/wolfcrypt/src/ed448.c +++ b/wolfcrypt/src/ed448.c @@ -43,8 +43,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$e") - #pragma const_seg(".fipsB$e") + #pragma code_seg(".fipsA$fb") + #pragma const_seg(".fipsB$fb") #endif #endif diff --git a/wolfcrypt/src/hmac.c b/wolfcrypt/src/hmac.c index 0fe4daca5..060897355 100644 --- a/wolfcrypt/src/hmac.c +++ b/wolfcrypt/src/hmac.c @@ -35,8 +35,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$b") - #pragma const_seg(".fipsB$b") + #pragma code_seg(".fipsA$g") + #pragma const_seg(".fipsB$g") #endif #endif diff --git a/wolfcrypt/src/kdf.c b/wolfcrypt/src/kdf.c index d15eacd09..d100037db 100644 --- a/wolfcrypt/src/kdf.c +++ b/wolfcrypt/src/kdf.c @@ -35,8 +35,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$m") - #pragma const_seg(".fipsB$m") + #pragma code_seg(".fipsA$h") + #pragma const_seg(".fipsB$h") #endif #endif diff --git a/wolfcrypt/src/port/kcapi/kcapi_aes.c b/wolfcrypt/src/port/kcapi/kcapi_aes.c index bf87340a3..1f1aa03f4 100644 --- a/wolfcrypt/src/port/kcapi/kcapi_aes.c +++ b/wolfcrypt/src/port/kcapi/kcapi_aes.c @@ -39,8 +39,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$g") - #pragma const_seg(".fipsB$g") + #pragma code_seg(".fipsA$ba") + #pragma const_seg(".fipsB$ba") #endif #endif diff --git a/wolfcrypt/src/pwdbased.c b/wolfcrypt/src/pwdbased.c index 3c16ee395..cfebea2f1 100644 --- a/wolfcrypt/src/pwdbased.c +++ b/wolfcrypt/src/pwdbased.c @@ -33,8 +33,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$e") - #pragma const_seg(".fipsB$e") + #pragma code_seg(".fipsA$ha") + #pragma const_seg(".fipsB$ha") #endif #endif diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index ad5ab9f96..272afd93c 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -50,8 +50,8 @@ This library contains implementation for the random number generator. #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$c") - #pragma const_seg(".fipsB$c") + #pragma code_seg(".fipsA$i") + #pragma const_seg(".fipsB$i") #endif #endif @@ -1486,7 +1486,7 @@ int wc_Entropy_Get(int bits, unsigned char* entropy, word32 len) * @return ENTROPY_RT_E or ENTROPY_APT_E on failure. * @return BAD_MUTEX_E when unable to lock mutex. */ -int wc_Entropy_OnDemandTest() +int wc_Entropy_OnDemandTest(void) { int ret = 0; @@ -1514,7 +1514,7 @@ int wc_Entropy_OnDemandTest() * @return 0 on success. * @return Negative on failure. */ -int Entropy_Init() +int Entropy_Init(void) { int ret = 0; @@ -1551,7 +1551,7 @@ int Entropy_Init() /* Finalize the data associated with the MemUse Entropy source. */ -void Entropy_Final() +void Entropy_Final(void) { /* Only finalize when initialized. */ if (entropy_memuse_initialized) { diff --git a/wolfcrypt/src/rsa.c b/wolfcrypt/src/rsa.c index 87f4d9b39..b11740f4e 100644 --- a/wolfcrypt/src/rsa.c +++ b/wolfcrypt/src/rsa.c @@ -40,8 +40,8 @@ RSA keys can be used to encrypt, decrypt, sign and verify data. #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$e") - #pragma const_seg(".fipsB$e") + #pragma code_seg(".fipsA$j") + #pragma const_seg(".fipsB$j") #endif #endif diff --git a/wolfcrypt/src/sha.c b/wolfcrypt/src/sha.c index e3e57795b..86d2f83b9 100644 --- a/wolfcrypt/src/sha.c +++ b/wolfcrypt/src/sha.c @@ -41,8 +41,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$j") - #pragma const_seg(".fipsB$j") + #pragma code_seg(".fipsA$k") + #pragma const_seg(".fipsB$k") #endif #endif diff --git a/wolfcrypt/src/sha256.c b/wolfcrypt/src/sha256.c index 49a2d939c..c33e11f86 100644 --- a/wolfcrypt/src/sha256.c +++ b/wolfcrypt/src/sha256.c @@ -71,8 +71,8 @@ on the specific device platform. #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$d") - #pragma const_seg(".fipsB$d") + #pragma code_seg(".fipsA$l") + #pragma const_seg(".fipsB$l") #endif #endif diff --git a/wolfcrypt/src/sha3.c b/wolfcrypt/src/sha3.c index c5441cc06..f639dabb1 100644 --- a/wolfcrypt/src/sha3.c +++ b/wolfcrypt/src/sha3.c @@ -34,8 +34,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$l") - #pragma const_seg(".fipsB$l") + #pragma code_seg(".fipsA$n") + #pragma const_seg(".fipsB$n") #endif #endif diff --git a/wolfcrypt/src/sha512.c b/wolfcrypt/src/sha512.c index 032e3f4d2..e4509c038 100644 --- a/wolfcrypt/src/sha512.c +++ b/wolfcrypt/src/sha512.c @@ -50,8 +50,8 @@ #define FIPS_NO_WRAPPERS #ifdef USE_WINDOWS_API - #pragma code_seg(".fipsA$k") - #pragma const_seg(".fipsB$k") + #pragma code_seg(".fipsA$m") + #pragma const_seg(".fipsB$m") #endif #endif