Jerry Yu
d6e312dde4
replace aesni target detection macros
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-23 17:15:34 +08:00
Jerry Yu
72fd0bdc71
replace arm64 macro and aesce enable flag
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-23 17:15:34 +08:00
Dave Rodgman
f2249ec905
Rename mbedtls_aesce_has_support macro to satisfy case rules
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-08-20 20:20:12 +01:00
Dave Rodgman
1fdc884ed8
Merge pull request #7384 from yuhaoth/pr/add-aes-accelerator-only-mode
...
AES: Add accelerator only mode
2023-08-18 20:55:44 +00:00
Jerry Yu
61fc5ed5f3
improve readability of error message
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-18 17:28:48 +08:00
Jerry Yu
372f7a04d0
Add missing check
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-18 17:26:25 +08:00
Jerry Yu
9608447545
replace padlock_c with padlock_have_code
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-17 18:10:45 +08:00
Jerry Yu
3a0f044bde
improve readability
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-17 17:06:21 +08:00
Jerry Yu
e9c6b53e74
remove return-type when runtime detection enabled without plain c
...
This case does not exist
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-17 13:53:38 +08:00
Jerry Yu
1b4c7eda80
add hardware only check for padlock
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-17 11:25:17 +08:00
Jerry Yu
9e628621b4
Add via padlock detection macro
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-17 11:20:09 +08:00
Jerry Yu
2319af0d64
Change the order of runtime detection
...
If aesni is available, we will use it.
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-17 10:38:57 +08:00
Antonio de Angelis
1ee4d1228c
Fix error strings without quotes
...
Some of the error strings that should be printed with the
error preprocessor directive are missing quotes
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
2023-08-16 12:48:33 +01:00
Jerry Yu
516cf27d45
fix msvc build fail on i386 target
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-16 17:33:32 +08:00
Jerry Yu
cc068ae631
fix -Werror=return-type
when runtime detection enabled and plain c disabled
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-16 16:14:01 +08:00
Jerry Yu
e62ff09569
Restore aesni for i386
...
intrinsic code can be work on i386 also
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-16 14:33:16 +08:00
Paul Elliott
2ad93674dc
Fix potential corruption of IV for AES CBC
...
If passed a zero length, AES CBC could potentially corrupt the passed
in IV by memcpying it over itself. Although this might be ok with
more recent compilers, its not for every compiler we support. Found
by coverity.
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
2023-08-11 17:04:06 +01:00
Jerry Yu
8189f32945
improve aesni check for x86_64
...
`MBEDTLS_AESNI_C` does not depends on `MBEDTLS_HAVE_ASM`
when intrinsic is available.
And compiler relative checks only work on x86_64, it should
be only checked on x86_64.
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-10 15:17:45 +08:00
Jerry Yu
13696bb07b
improve check config option for i386
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-10 13:36:32 +08:00
Jerry Yu
ba42b076f9
Remove asm check for aarch64 aesce
...
we implement it with aesce intrinsic. No asm needed.
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-10 12:53:26 +08:00
Jerry Yu
c4508c07f6
improve error message and config check for padlock
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-08 12:57:06 +08:00
Jerry Yu
5fcdd6a28a
remove unnecessary definition
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-07 15:32:58 +08:00
Tom Cosgrove
ce37c5e1ce
Update links to Rijndael paper and NIST SP 800-90 DRBGs
...
The link to the DRBG paper points to the March 2007 version, the same as the
original link (rather than the latest version).
The amended Rijndael paper has a two-page "Note on naming" prefix.
Fixes #7193
Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
2023-08-04 13:55:03 +01:00
Jerry Yu
fce351def8
improve platform relative check
...
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-04 17:13:36 +08:00
Jerry Yu
29c91ba42d
fix unreachable code warnings
...
It is detected by clang with bellow patch
```
diff --git a/library/Makefile b/library/Makefile
index fdab4f4ba0..967f9e2e65 100644
--- a/library/Makefile
+++ b/library/Makefile
@@ -306,8 +306,8 @@ libmbedcrypto.dll: $(OBJS_CRYPTO)
.c.o:
echo " CC $<"
- $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -o $@ -c $<
-
+ $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -o $(@:%.o=%.i) -E $<
+ $(CC) $(LOCAL_CFLAGS) -Wunreachable-code -Werror -Wno-unused-command-line-argument $(CFLAGS) -o $@ -c $(@:%.o=%.i)
.PHONY: generated_files
GENERATED_FILES = \
error.c version_features.c \
```
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-04 16:29:06 +08:00
Jerry Yu
6943681820
Improve error message and documents
...
- fix grammar error
- Add more information for AES_USE_HARDWARE_ONLY
- Improve error message
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-02 17:44:03 +08:00
Jerry Yu
02b1519ab6
move accelerator checks to aes.c
...
Origin position is always validate due to conflict
between the guards in `aes.c` and module undef check
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
2023-08-02 17:44:02 +08:00
Yanray Wang
5adfdbdaed
AES: fix mismatch comment in #endif
...
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-07-06 17:10:44 +08:00
Dave Rodgman
c8d81ad54d
Merge pull request #7784 from daverodgman/aesce-unroll
2023-07-04 18:41:13 +01:00
Tom Cosgrove
9b20c6fcc1
Merge pull request #7840 from yanrayw/7381_aes_gen_table
...
AES: use uint8_t for array of pow and log to save RAM usage
2023-07-04 08:34:12 +01:00
Dave Rodgman
9cf17dad9d
Merge pull request #7851 from daverodgman/fix-unused-aes
...
Fix AES dependencies - build TF-M config cleanly
2023-07-03 16:49:00 +01:00
Dave Rodgman
afe85db42b
Improve #endif comments
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:07:11 +01:00
Dave Rodgman
1be2463d76
Correct #endif comments
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:01:24 +01:00
Dave Rodgman
710e3c650f
Correct comments on #endif's
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-29 12:00:14 +01:00
Dave Rodgman
2fd8c2c708
code style
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-27 21:03:31 +01:00
Dave Rodgman
160088d769
Fix comment
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-27 20:41:51 +01:00
Dave Rodgman
ad4e76be57
More dependency fixes
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-27 19:23:14 +01:00
Dave Rodgman
34152a48d4
Fix unused variable
...
Fix when MBEDTLS_AES_SETKEY_ENC_ALT, MBEDTLS_AES_DECRYPT_ALT and
MBEDTLS_AES_ROM_TABLE set.
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-27 19:23:09 +01:00
Dave Rodgman
15cd28a264
Fix unused variable if MBEDTLS_AES_SETKEY_ENC_ALT and MBEDTLS_AES_DECRYPT_ALT set
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-27 19:23:06 +01:00
Dave Rodgman
28a539a549
Fix unused fn when MBEDTLS_AES_SETKEY_DEC_ALT and MBEDTLS_AES_SETKEY_ENC_ALT set
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-27 19:23:01 +01:00
Dave Rodgman
8c753f99cb
Fix unused function when MBEDTLS_AES_SETKEY_ENC_ALT set
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-27 19:22:56 +01:00
Yanray Wang
fe944ce2d8
aes.c: use uint8_t for local x, y, z in aes_gen_tables to save RAM
...
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-06-27 18:18:06 +08:00
Yanray Wang
5c86b1775a
aes.c: use uint8_t for array of pow and log to save RAM
...
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
2023-06-27 18:18:06 +08:00
Dave Rodgman
086e137dc4
code style
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-16 20:21:39 +01:00
Dave Rodgman
96a9e6a9dd
Address test review comments
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-16 20:18:36 +01:00
Dave Rodgman
4ad81ccdae
Only force O2 when hw acceleration available
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-16 15:04:04 +01:00
Dave Rodgman
b2814bd089
Only enable gcc -Os fix if we have AES hw support
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-16 14:50:33 +01:00
Dave Rodgman
9bb7e6f4ce
Rename MBEDTLS_OPTIMIZE_ALWAYS
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-16 09:41:21 +01:00
Dave Rodgman
2dd15b3ab5
code style
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-15 20:27:53 +01:00
Dave Rodgman
6cfd9b54ae
use MBEDTLS_OPTIMIZE_ALWAYS in AES-XTS
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-06-15 18:46:23 +01:00