@@ -27,12 +27,12 @@ QEMU seems to also need
27
27
Then run normal make or cmake etc.
28
28
---
29
29
30
- --- a/ChangeLog.d/armv8_crypto_extensions.txt
30
+ --- /dev/null
31
31
+++ b/ChangeLog.d/armv8_crypto_extensions.txt
32
32
@@ -0,0 +1,2 @@
33
33
+ Features
34
34
+ * Support ARMv8 Cryptography Extensions for AES and GCM.
35
- --- a/include/mbedtls/armv8ce_aes.h
35
+ --- /dev/null
36
36
+++ b/include/mbedtls/armv8ce_aes.h
37
37
@@ -0,0 +1,63 @@
38
38
+ /**
@@ -100,7 +100,7 @@ Then run normal make or cmake etc.
100
100
+ #endif /* MBEDTLS_ARMV8CE_AES_H */
101
101
--- a/include/mbedtls/check_config.h
102
102
+++ b/include/mbedtls/check_config.h
103
- @@ -95 ,6 +95 ,10 @@
103
+ @@ -72 ,6 +72 ,10 @@
104
104
#error "MBEDTLS_AESNI_C defined, but not all prerequisites"
105
105
#endif
106
106
@@ -111,22 +111,22 @@ Then run normal make or cmake etc.
111
111
#if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C)
112
112
#error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites"
113
113
#endif
114
- @@ -772 ,3 +776 ,4 @@
114
+ @@ -897 ,3 +901 ,4 @@
115
115
typedef int mbedtls_iso_c_forbids_empty_translation_units;
116
116
117
117
#endif /* MBEDTLS_CHECK_CONFIG_H */
118
118
+
119
119
--- a/include/mbedtls/config.h
120
120
+++ b/include/mbedtls/config.h
121
- @@ -73 ,6 +73 ,7 @@
121
+ @@ -46 ,6 +46 ,7 @@
122
122
* Requires support for asm() in compiler.
123
123
*
124
124
* Used in:
125
125
+ * library/armv8ce_aes.c
126
126
* library/aria.c
127
127
* library/timing.c
128
128
* include/mbedtls/bn_mul.h
129
- @@ -1888 ,6 +1889 ,21 @@
129
+ @@ -2313 ,6 +2314 ,21 @@
130
130
#define MBEDTLS_AESNI_C
131
131
132
132
/**
@@ -150,7 +150,7 @@ Then run normal make or cmake etc.
150
150
* Enable the AES block cipher.
151
151
--- a/library/aes.c
152
152
+++ b/library/aes.c
153
- @@ -69 ,7 +69 ,9 @@
153
+ @@ -39 ,7 +39 ,9 @@
154
154
#if defined(MBEDTLS_AESNI_C)
155
155
#include "mbedtls/aesni.h"
156
156
#endif
@@ -161,7 +161,7 @@ Then run normal make or cmake etc.
161
161
#if defined(MBEDTLS_SELF_TEST)
162
162
#if defined(MBEDTLS_PLATFORM_C)
163
163
#include "mbedtls/platform.h"
164
- @@ -1052 ,6 +1054 ,11 @@
164
+ @@ -999 ,6 +1001 ,11 @@ int mbedtls_aes_crypt_ecb( mbedtls_aes_c
165
165
return( mbedtls_aesni_crypt_ecb( ctx, mode, input, output ) );
166
166
#endif
167
167
@@ -173,7 +173,7 @@ Then run normal make or cmake etc.
173
173
#if defined(MBEDTLS_PADLOCK_C) && defined(MBEDTLS_HAVE_X86)
174
174
if( aes_padlock_ace )
175
175
{
176
- --- a/library/armv8ce_aes.c
176
+ --- /dev/null
177
177
+++ b/library/armv8ce_aes.c
178
178
@@ -0,0 +1,142 @@
179
179
+ /*
@@ -320,7 +320,7 @@ Then run normal make or cmake etc.
320
320
+ #endif /* MBEDTLS_ARMV8CE_AES_C */
321
321
--- a/library/CMakeLists.txt
322
322
+++ b/library/CMakeLists.txt
323
- @@ -7 ,6 +7 ,7 @@
323
+ @@ -15 ,6 +15 ,7 @@ set(src_crypto
324
324
aesni.c
325
325
arc4.c
326
326
aria.c
@@ -330,7 +330,7 @@ Then run normal make or cmake etc.
330
330
base64.c
331
331
--- a/library/gcm.c
332
332
+++ b/library/gcm.c
333
- @@ -71 ,6 +71 ,10 @@
333
+ @@ -41 ,6 +41 ,10 @@
334
334
#include "mbedtls/aesni.h"
335
335
#endif
336
336
@@ -341,7 +341,7 @@ Then run normal make or cmake etc.
341
341
#if defined(MBEDTLS_SELF_TEST) && defined(MBEDTLS_AES_C)
342
342
#include "mbedtls/aes.h"
343
343
#include "mbedtls/platform.h"
344
- @@ -140 ,6 +144 ,12 @@
344
+ @@ -87 ,6 +91 ,12 @@ static int gcm_gen_table( mbedtls_gcm_co
345
345
if( ( ret = mbedtls_cipher_update( &ctx->cipher_ctx, h, 16, h, &olen ) ) != 0 )
346
346
return( ret );
347
347
@@ -352,9 +352,9 @@ Then run normal make or cmake etc.
352
352
+ #endif
353
353
+
354
354
/* pack h as two 64-bits ints, big-endian */
355
- GET_UINT32_BE( hi, h, 0 );
356
- GET_UINT32_BE( lo, h, 4 );
357
- @@ -248 ,6 +258 ,11 @@
355
+ hi = MBEDTLS_GET_UINT32_BE( h, 0 );
356
+ lo = MBEDTLS_GET_UINT32_BE( h, 4 );
357
+ @@ -196 ,6 +206 ,11 @@ static void gcm_mult( mbedtls_gcm_contex
358
358
unsigned char lo, hi, rem;
359
359
uint64_t zh, zl;
360
360
@@ -368,18 +368,17 @@ Then run normal make or cmake etc.
368
368
unsigned char h[16];
369
369
--- a/library/Makefile
370
370
+++ b/library/Makefile
371
- @@ -72,6 +72,7 @@
372
- aesni.o \
373
- arc4.o \
371
+ @@ -74,6 +74,7 @@ OBJS_CRYPTO= \
374
372
aria.o \
375
- + armv8ce_aes.o \
376
373
asn1parse.o \
377
374
asn1write.o \
375
+ + armv8ce_aes.o \
378
376
base64.o \
379
-
377
+ bignum.o \
378
+ blowfish.o \
380
379
--- a/library/version_features.c
381
380
+++ b/library/version_features.c
382
- @@ -583 ,6 +583 ,9 @@
381
+ @@ -624 ,6 +624 ,9 @@ static const char * const features[] = {
383
382
#if defined(MBEDTLS_AESNI_C)
384
383
"MBEDTLS_AESNI_C",
385
384
#endif /* MBEDTLS_AESNI_C */
0 commit comments