mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 16:22:29 +00:00
Get MbedTLS and its unit tests passing AARCH64
This commit is contained in:
parent
5e2f7f7ced
commit
4edbc98811
37 changed files with 632 additions and 725 deletions
7
third_party/mbedtls/bigmul.c
vendored
7
third_party/mbedtls/bigmul.c
vendored
|
@ -273,6 +273,7 @@ int mbedtls_mpi_mul_mpi(mbedtls_mpi *X, const mbedtls_mpi *A,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
if (!IsTiny() && i == j) {
|
||||
if (X->n < i * 2) {
|
||||
if ((ret = mbedtls_mpi_grow(X, i * 2))) return ret;
|
||||
|
@ -293,6 +294,7 @@ int mbedtls_mpi_mul_mpi(mbedtls_mpi *X, const mbedtls_mpi *A,
|
|||
return 0;
|
||||
}
|
||||
}
|
||||
#endif /* __x86_64__ */
|
||||
|
||||
mbedtls_mpi_init( &TA );
|
||||
mbedtls_mpi_init( &TB );
|
||||
|
@ -310,9 +312,8 @@ int mbedtls_mpi_mul_mpi(mbedtls_mpi *X, const mbedtls_mpi *A,
|
|||
B = &TB;
|
||||
}
|
||||
if (!IsTiny() &&
|
||||
i >= 16 && i == j && !(i & (i - 1)) &&
|
||||
X86_HAVE(BMI2) && X86_HAVE(ADX) &&
|
||||
(K = malloc(i * 4 * sizeof(*K)))) {
|
||||
i >= 16 && i == j && !(i & (i - 1)) &&
|
||||
(K = malloc(i * 4 * sizeof(*K)))) {
|
||||
Karatsuba(X->p, A->p, B->p, i, K);
|
||||
free(K);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue