forked from HandsomeMod/HandsomeMod
-
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.
- Loading branch information
HandsomeYingyan
committed
Oct 29, 2021
1 parent
20bfe16
commit 2ad6b16
Showing
36 changed files
with
219 additions
and
80 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
116 changes: 116 additions & 0 deletions
116
package/libs/wolfssl/patches/001-Maths-x86-asm-change-asm-snippets-to-get-compiling.patch
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,116 @@ | ||
From fa8f23284d4689c2a737204b337b58d966dcbd8c Mon Sep 17 00:00:00 2001 | ||
From: Sean Parkinson <sean@wolfssl.com> | ||
Date: Fri, 20 Aug 2021 10:23:38 +1000 | ||
Subject: [PATCH] Maths x86 asm: change asm snippets to get compiling | ||
|
||
TFM: | ||
Use register or memory for c0, c1, c2 in SQRADD and SQRADD2. | ||
SP: | ||
Use register or memory for vl, vh, vo in SP_ASM_MUL_ADD, | ||
SP_ASM_MUL_ADD2 and SP_ASM_SQR_ADD. | ||
--- | ||
wolfcrypt/src/asm.c | 29 ++++++++++++++++++++--------- | ||
wolfcrypt/src/sp_int.c | 6 +++--- | ||
2 files changed, 23 insertions(+), 12 deletions(-) | ||
|
||
--- a/wolfcrypt/src/asm.c | ||
+++ b/wolfcrypt/src/asm.c | ||
@@ -698,33 +698,39 @@ __asm__( \ | ||
|
||
#define SQRADD(i, j) \ | ||
__asm__( \ | ||
- "movl %6,%%eax \n\t" \ | ||
+ "movl %3,%%eax \n\t" \ | ||
"mull %%eax \n\t" \ | ||
"addl %%eax,%0 \n\t" \ | ||
"adcl %%edx,%1 \n\t" \ | ||
"adcl $0,%2 \n\t" \ | ||
- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i) :"%eax","%edx","cc"); | ||
+ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \ | ||
+ : "m"(i) \ | ||
+ :"%eax","%edx","cc"); | ||
|
||
#define SQRADD2(i, j) \ | ||
__asm__( \ | ||
- "movl %6,%%eax \n\t" \ | ||
- "mull %7 \n\t" \ | ||
+ "movl %3,%%eax \n\t" \ | ||
+ "mull %4 \n\t" \ | ||
"addl %%eax,%0 \n\t" \ | ||
"adcl %%edx,%1 \n\t" \ | ||
"adcl $0,%2 \n\t" \ | ||
"addl %%eax,%0 \n\t" \ | ||
"adcl %%edx,%1 \n\t" \ | ||
"adcl $0,%2 \n\t" \ | ||
- :"=r"(c0), "=r"(c1), "=r"(c2): "0"(c0), "1"(c1), "2"(c2), "m"(i), "m"(j) :"%eax","%edx", "cc"); | ||
+ :"+rm"(c0), "+rm"(c1), "+rm"(c2) \ | ||
+ : "m"(i), "m"(j) \ | ||
+ :"%eax","%edx", "cc"); | ||
|
||
#define SQRADDSC(i, j) \ | ||
-__asm__( \ | ||
+__asm__( \ | ||
"movl %3,%%eax \n\t" \ | ||
"mull %4 \n\t" \ | ||
"movl %%eax,%0 \n\t" \ | ||
"movl %%edx,%1 \n\t" \ | ||
"xorl %2,%2 \n\t" \ | ||
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "g"(i), "g"(j) :"%eax","%edx","cc"); | ||
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \ | ||
+ : "g"(i), "g"(j) \ | ||
+ :"%eax","%edx","cc"); | ||
|
||
#define SQRADDAC(i, j) \ | ||
__asm__( \ | ||
@@ -733,7 +739,9 @@ __asm__( | ||
"addl %%eax,%0 \n\t" \ | ||
"adcl %%edx,%1 \n\t" \ | ||
"adcl $0,%2 \n\t" \ | ||
- :"=r"(sc0), "=r"(sc1), "=r"(sc2): "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) :"%eax","%edx","cc"); | ||
+ :"=r"(sc0), "=r"(sc1), "=r"(sc2) \ | ||
+ : "0"(sc0), "1"(sc1), "2"(sc2), "g"(i), "g"(j) \ | ||
+ :"%eax","%edx","cc"); | ||
|
||
#define SQRADDDB \ | ||
__asm__( \ | ||
@@ -743,7 +751,10 @@ __asm__( | ||
"addl %6,%0 \n\t" \ | ||
"adcl %7,%1 \n\t" \ | ||
"adcl %8,%2 \n\t" \ | ||
- :"=r"(c0), "=r"(c1), "=r"(c2) : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), "r"(sc2) : "cc"); | ||
+ :"=r"(c0), "=r"(c1), "=r"(c2) \ | ||
+ : "0"(c0), "1"(c1), "2"(c2), "r"(sc0), "r"(sc1), \ | ||
+ "r"(sc2) \ | ||
+ : "cc"); | ||
|
||
#elif defined(TFM_X86_64) | ||
/* x86-64 optimized */ | ||
--- a/wolfcrypt/src/sp_int.c | ||
+++ b/wolfcrypt/src/sp_int.c | ||
@@ -476,7 +476,7 @@ static WC_INLINE sp_int_digit sp_div_wor | ||
"addl %%eax, %[l] \n\t" \ | ||
"adcl %%edx, %[h] \n\t" \ | ||
"adcl $0 , %[o] \n\t" \ | ||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ | ||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ | ||
: [a] "r" (va), [b] "r" (vb) \ | ||
: "eax", "edx", "cc" \ | ||
) | ||
@@ -502,7 +502,7 @@ static WC_INLINE sp_int_digit sp_div_wor | ||
"addl %%eax, %[l] \n\t" \ | ||
"adcl %%edx, %[h] \n\t" \ | ||
"adcl $0 , %[o] \n\t" \ | ||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ | ||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ | ||
: [a] "r" (va), [b] "r" (vb) \ | ||
: "eax", "edx", "cc" \ | ||
) | ||
@@ -541,7 +541,7 @@ static WC_INLINE sp_int_digit sp_div_wor | ||
"addl %%eax, %[l] \n\t" \ | ||
"adcl %%edx, %[h] \n\t" \ | ||
"adcl $0 , %[o] \n\t" \ | ||
- : [l] "+r" (vl), [h] "+r" (vh), [o] "+r" (vo) \ | ||
+ : [l] "+rm" (vl), [h] "+rm" (vh), [o] "+rm" (vo) \ | ||
: [a] "m" (va) \ | ||
: "eax", "edx", "cc" \ | ||
) |
22 changes: 22 additions & 0 deletions
22
package/libs/wolfssl/patches/002-Update-macro-guard-on-SHA256-transform-call.patch
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,22 @@ | ||
From f447e4c1fa4c932c0286fa0331966756e243db81 Mon Sep 17 00:00:00 2001 | ||
From: JacobBarthelmeh <jacob@wolfssl.com> | ||
Date: Fri, 17 Sep 2021 15:06:13 -0700 | ||
Subject: [PATCH] update macro guard on SHA256 transform call | ||
|
||
--- | ||
src/ssl.c | 3 ++- | ||
tests/api.c | 3 ++- | ||
2 files changed, 4 insertions(+), 2 deletions(-) | ||
|
||
--- a/src/ssl.c | ||
+++ b/src/ssl.c | ||
@@ -17639,7 +17639,8 @@ size_t wolfSSL_get_client_random(const W | ||
|
||
#if defined(OPENSSL_EXTRA) | ||
#if !defined(HAVE_SELFTEST) && (!defined(HAVE_FIPS) || \ | ||
- (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2))) | ||
+ (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION > 2))) && \ | ||
+ !defined(WOLFSSL_DEVCRYPTO_HASH) && !defined(WOLFSSL_AFALG_HASH) | ||
/* Apply SHA256 transformation to the data */ | ||
int wolfSSL_SHA256_Transform(WOLFSSL_SHA256_CTX* sha256, | ||
const unsigned char* 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
13 changes: 13 additions & 0 deletions
13
package/libs/wolfssl/patches/110-build-with-libtool-2.4.patch
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 @@ | ||
diff --git a/configure.ac b/configure.ac | ||
index 144c857e4..de7f6b45a 100644 | ||
--- a/configure.ac | ||
+++ b/configure.ac | ||
@@ -32,7 +32,7 @@ AC_ARG_PROGRAM | ||
|
||
AC_CONFIG_HEADERS([config.h:config.in]) | ||
|
||
-LT_PREREQ([2.4.2]) | ||
+LT_PREREQ([2.4]) | ||
LT_INIT([disable-static win32-dll]) | ||
|
||
#shared library versioning |
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
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
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
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
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
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
Oops, something went wrong.