diff --git a/c8_remote/CMakeLists.txt b/c8_remote/CMakeLists.txt index 62a6b47..5959791 100644 --- a/c8_remote/CMakeLists.txt +++ b/c8_remote/CMakeLists.txt @@ -8,4 +8,4 @@ include_directories(include) add_executable(checkm8_remote main.c src/usb_helpers.c src/exploit.c src/payload.c src/command.c) target_link_libraries(checkm8_remote usb-1.0 pthread udev m) -target_link_libraries(checkm8_remote payload experiments crypto_host) \ No newline at end of file +target_link_libraries(checkm8_remote payload experiments host_crypto) \ No newline at end of file diff --git a/c8_remote/include/crypto_host.h b/c8_remote/include/host_crypto.h similarity index 75% rename from c8_remote/include/crypto_host.h rename to c8_remote/include/host_crypto.h index a167f82..f475417 100644 --- a/c8_remote/include/crypto_host.h +++ b/c8_remote/include/host_crypto.h @@ -1,5 +1,5 @@ -#ifndef CHECKM8_TOOL_CRYPTO_HOST_H -#define CHECKM8_TOOL_CRYPTO_HOST_H +#ifndef CHECKM8_TOOL_HOST_CRYPTO_H +#define CHECKM8_TOOL_HOST_CRYPTO_H #include "bootrom_type.h" @@ -11,4 +11,4 @@ void aes128_encrypt_ecb(unsigned char *msg, unsigned int msg_len, struct aes_constants *get_constants(); -#endif //CHECKM8_TOOL_CRYPTO_HOST_H +#endif //CHECKM8_TOOL_HOST_CRYPTO_H diff --git a/c8_remote/lib/CMakeLists.txt b/c8_remote/lib/CMakeLists.txt index 7b9100f..fbbb94a 100644 --- a/c8_remote/lib/CMakeLists.txt +++ b/c8_remote/lib/CMakeLists.txt @@ -42,4 +42,4 @@ add_custom_command(TARGET payload POST_BUILD add_library(experiments experiments/aes_sw.c experiments/system.c experiments/power.c) -add_library(crypto_host crypto/aes_sw_impl.c crypto/aes_sw_host.c) \ No newline at end of file +add_library(host_crypto crypto/aes_sw_impl.c crypto/aes_sw_host.c) \ No newline at end of file diff --git a/c8_remote/lib/crypto/aes_sw_impl.c b/c8_remote/lib/crypto/aes_sw_impl.c index dfa24f5..d001940 100644 --- a/c8_remote/lib/crypto/aes_sw_impl.c +++ b/c8_remote/lib/crypto/aes_sw_impl.c @@ -1,6 +1,6 @@ #include "bootrom_type.h" -#ifdef CRYPTO_DEV +#ifdef DEV_CRYPTO #include "dev_util.h" PAYLOAD_SECTION @@ -17,7 +17,7 @@ void sub_bytes(unsigned char block[16], struct aes_constants *c) } } -#ifdef CRYPTO_DEV +#ifdef DEV_CRYPTO PAYLOAD_SECTION #endif void shift_rows(unsigned char block[16]) @@ -44,7 +44,7 @@ void shift_rows(unsigned char block[16]) block[0x7] = temp1; } -#ifdef CRYPTO_DEV +#ifdef DEV_CRYPTO PAYLOAD_SECTION #endif void mix_cols(unsigned char block[16], struct aes_constants *c) @@ -67,7 +67,7 @@ void mix_cols(unsigned char block[16], struct aes_constants *c) } } -#ifdef CRYPTO_DEV +#ifdef DEV_CRYPTO PAYLOAD_SECTION #endif void add_key(unsigned char block[16], unsigned char key[16]) @@ -79,7 +79,7 @@ void add_key(unsigned char block[16], unsigned char key[16]) } } -#ifdef CRYPTO_DEV +#ifdef DEV_CRYPTO PAYLOAD_SECTION #endif void expand_key(unsigned char key[16], unsigned char key_sched[176], int n, @@ -120,7 +120,7 @@ void expand_key(unsigned char key[16], unsigned char key_sched[176], int n, } } -#ifdef CRYPTO_DEV +#ifdef DEV_CRYPTO PAYLOAD_SECTION #endif void aes128_encrypt_ecb(unsigned char *msg, unsigned int msg_len, diff --git a/c8_remote/lib/experiments/aes_sw.c b/c8_remote/lib/experiments/aes_sw.c index f94826b..3ba1cbf 100644 --- a/c8_remote/lib/experiments/aes_sw.c +++ b/c8_remote/lib/experiments/aes_sw.c @@ -8,7 +8,7 @@ #include "bootrom_addr.h" #include "usb_helpers.h" #include "command.h" -#include "crypto_host.h" +#include "host_crypto.h" DEV_PTR_T install_aes_data(struct pwned_device *dev) { diff --git a/c8_remote/lib/payload/CMakeLists.txt b/c8_remote/lib/payload/CMakeLists.txt index 8b0e7d0..88e25f9 100644 --- a/c8_remote/lib/payload/CMakeLists.txt +++ b/c8_remote/lib/payload/CMakeLists.txt @@ -38,8 +38,8 @@ foreach(NAME ${PL_NAMES}) ${CMAKE_CURRENT_BINARY_DIR}/bin/payload_${NAME}.bin) endforeach(NAME) -add_library(crypto_dev ../crypto/aes_sw_impl.c) -target_compile_definitions(crypto_dev PRIVATE CRYPTO_DEV) +add_library(dev_crypto ../crypto/aes_sw_impl.c) +target_compile_definitions(dev_crypto PRIVATE DEV_CRYPTO) -target_link_libraries(payload_aes_sw_bern crypto_dev) -target_link_libraries(payload_aes_sw_corr crypto_dev) \ No newline at end of file +target_link_libraries(payload_aes_sw_bern dev_crypto) +target_link_libraries(payload_aes_sw_corr dev_crypto) \ No newline at end of file diff --git a/c8_remote/lib/payload/include/crypto_dev.h b/c8_remote/lib/payload/include/dev_crypto.h similarity index 100% rename from c8_remote/lib/payload/include/crypto_dev.h rename to c8_remote/lib/payload/include/dev_crypto.h diff --git a/c8_remote/lib/payload/src/aes_sw_bern.c b/c8_remote/lib/payload/src/aes_sw_bern.c index 1ab1f31..2639a58 100644 --- a/c8_remote/lib/payload/src/aes_sw_bern.c +++ b/c8_remote/lib/payload/src/aes_sw_bern.c @@ -1,7 +1,7 @@ #include "bootrom_func.h" #include "bootrom_type.h" #include "cacheutil.h" -#include "crypto_dev.h" +#include "dev_crypto.h" PAYLOAD_SECTION uint64_t entry_sync(unsigned char *msg, unsigned int msg_len, unsigned char key[16], diff --git a/c8_remote/lib/payload/src/aes_sw_corr.c b/c8_remote/lib/payload/src/aes_sw_corr.c index 9e81942..12f9f2c 100644 --- a/c8_remote/lib/payload/src/aes_sw_corr.c +++ b/c8_remote/lib/payload/src/aes_sw_corr.c @@ -1,6 +1,6 @@ #include "bootrom_func.h" #include "dev_util.h" -#include "crypto_dev.h" +#include "dev_crypto.h" PAYLOAD_SECTION void entry_sync() diff --git a/c8_remote/main.c b/c8_remote/main.c index 7cb7c77..1824bd3 100644 --- a/c8_remote/main.c +++ b/c8_remote/main.c @@ -10,7 +10,7 @@ #include "usb_helpers.h" #include "bootrom_type.h" #include "experiments.h" -#include "crypto_host.h" +#include "host_crypto.h" #ifdef CHECKM8_LOGGING