Make crypto lib naming more consistent

This commit is contained in:
2020-02-27 15:59:29 -05:00
parent 8cca9a2930
commit aff4be3a65
10 changed files with 19 additions and 19 deletions

View File

@@ -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)
target_link_libraries(checkm8_remote payload experiments host_crypto)

View File

@@ -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

View File

@@ -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)
add_library(host_crypto crypto/aes_sw_impl.c crypto/aes_sw_host.c)

View File

@@ -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,

View File

@@ -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)
{

View File

@@ -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)
target_link_libraries(payload_aes_sw_bern dev_crypto)
target_link_libraries(payload_aes_sw_corr dev_crypto)

View File

@@ -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],

View File

@@ -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()

View File

@@ -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