From ad1290d32dd73c25e88edc9f042448e78bd9c2d3 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Mon, 24 Apr 2017 19:18:08 -0700 Subject: [PATCH] fix build on phones --- board/crypto/hash-internal.h | 2 +- board/crypto/rsa.h | 4 ++-- board/crypto/sha.c | 4 ---- board/crypto/sha.h | 1 - board/crypto/stdint.h | 4 ++++ 5 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 board/crypto/stdint.h diff --git a/board/crypto/hash-internal.h b/board/crypto/hash-internal.h index c813b44..05ec3ec 100644 --- a/board/crypto/hash-internal.h +++ b/board/crypto/hash-internal.h @@ -27,7 +27,7 @@ #ifndef SYSTEM_CORE_INCLUDE_MINCRYPT_HASH_INTERNAL_H_ #define SYSTEM_CORE_INCLUDE_MINCRYPT_HASH_INTERNAL_H_ -#include +#include "stdint.h" #ifdef __cplusplus extern "C" { diff --git a/board/crypto/rsa.h b/board/crypto/rsa.h index 3d0556b..405f62e 100644 --- a/board/crypto/rsa.h +++ b/board/crypto/rsa.h @@ -28,12 +28,12 @@ #ifndef SYSTEM_CORE_INCLUDE_MINCRYPT_RSA_H_ #define SYSTEM_CORE_INCLUDE_MINCRYPT_RSA_H_ -#include - #ifdef __cplusplus extern "C" { #endif +#include "stdint.h" + #define RSANUMBYTES 256 /* 2048 bit key length */ #define RSANUMWORDS (RSANUMBYTES / sizeof(uint32_t)) diff --git a/board/crypto/sha.c b/board/crypto/sha.c index 40dac65..fa0ac26 100644 --- a/board/crypto/sha.c +++ b/board/crypto/sha.c @@ -29,10 +29,6 @@ #include "sha.h" -#include -#include -#include - #define rol(bits, value) (((value) << (bits)) | ((value) >> (32 - (bits)))) static void SHA1_Transform(SHA_CTX* ctx) { diff --git a/board/crypto/sha.h b/board/crypto/sha.h index ef60aab..4b51a53 100644 --- a/board/crypto/sha.h +++ b/board/crypto/sha.h @@ -26,7 +26,6 @@ #ifndef SYSTEM_CORE_INCLUDE_MINCRYPT_SHA1_H_ #define SYSTEM_CORE_INCLUDE_MINCRYPT_SHA1_H_ -#include #include "hash-internal.h" #ifdef __cplusplus diff --git a/board/crypto/stdint.h b/board/crypto/stdint.h new file mode 100644 index 0000000..67ac93e --- /dev/null +++ b/board/crypto/stdint.h @@ -0,0 +1,4 @@ +#define uint8_t unsigned char +#define uint32_t unsigned int +#define int64_t long long +#define uint64_t unsigned long long