forked from aws/aws-lc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create cut down fips_hashing library
- Loading branch information
Bill Yang
committed
Apr 24, 2024
1 parent
1b704e6
commit cbe52fa
Showing
6 changed files
with
27 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,19 @@ | ||
add_definitions(-DOPENSSL_NO_ASM=1) | ||
remove_definitions(-DBORINGSSL_FIPS -DFIPS_ENTROPY_SOURCE_JITTER_CPU -DFIPS_ENTROPY_SOURCE_PASSIVE) | ||
|
||
set(FIPS_HASHING_CRYPTO_OBJS "") | ||
|
||
foreach(file ${CRYPTO_OBJ_SOURCES}) | ||
set(modified_file "../${file}") | ||
list(APPEND FIPS_HASHING_CRYPTO_OBJS ${modified_file}) | ||
endforeach() | ||
add_library( | ||
fips_hashing | ||
|
||
fips_hashing.c | ||
|
||
set(GENERATE_CODE_ROOT "${PROJECT_SOURCE_DIR}/generated-src") | ||
file(COPY ${GENERATE_CODE_ROOT}/err_data.c DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) | ||
../mem.c | ||
../thread_none.c | ||
../thread_pthread.c | ||
|
||
add_library( | ||
clean_crypto_objects | ||
OBJECT | ||
${FIPS_HASHING_CRYPTO_OBJS} | ||
# ${DILITHIUM_SOURCES} | ||
# ${CRYPTO_ARCH_SOURCES} | ||
err_data.c | ||
../err/err.c | ||
../decrepit/ripemd/ripemd.c | ||
) | ||
|
||
target_compile_definitions(clean_crypto_objects PRIVATE BORINGSSL_IMPLEMENTATION) | ||
# For the prefix build, the object files need the prefix header files to build. | ||
add_dependencies(clean_crypto_objects boringssl_prefix_symbols) | ||
target_include_directories(clean_crypto_objects BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include) | ||
target_include_directories(clean_crypto_objects PRIVATE ${PROJECT_SOURCE_DIR}/include) | ||
add_library(fips_hashing $<TARGET_OBJECTS:clean_crypto_objects>) | ||
|
||
SET_TARGET_PROPERTIES(fips_hashing PROPERTIES LINKER_LANGUAGE C) | ||
target_link_libraries(fips_hashing PUBLIC nofipsmodule pthread) | ||
|
||
add_dependencies(fips_hashing boringssl_prefix_symbols) | ||
target_include_directories(fips_hashing BEFORE PRIVATE ${PROJECT_BINARY_DIR}/symbol_prefix_include) | ||
|
||
target_include_directories(fips_hashing PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include>) | ||
target_include_directories(fips_hashing PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>) | ||
target_link_libraries(fips_hashing generated_err_data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "../fipsmodule/delocate.h" | ||
|
||
#include "../fipsmodule/evp/p_hmac.c" | ||
#include "../fipsmodule/digest/digest.c" | ||
#include "../fipsmodule/digest/digests.c" | ||
#include "../fipsmodule/hmac/hmac.c" | ||
#include "../fipsmodule/md4/md4.c" | ||
#include "../fipsmodule/md5/md5.c" | ||
#include "../fipsmodule/sha/keccak1600.c" | ||
#include "../fipsmodule/sha/sha1.c" | ||
#include "../fipsmodule/sha/sha256.c" | ||
#include "../fipsmodule/sha/sha3.c" | ||
#include "../fipsmodule/sha/sha512.c" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters