00e8dd15d2
pk: manage parse and write for the new format
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-05-23 15:12:07 +02:00
b536126183
pk: manage allocate and free space when working with PSA private key
...
Allocation does not need to perform any action since the priv_id field
is already present on the pk_context.
Free should destroy the key. Of course this is true only if the key
is not opaque (because in that case it's the user responsibility
to do so).
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-05-23 15:12:07 +02:00
e0e6311b64
pk: change location of Montgomery helpers
...
This is to have them available only where they are really required.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-05-23 15:12:07 +02:00
8a6225062a
pk: move PSA error translation macros to internal header
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-05-23 15:12:07 +02:00
9dc9204b77
Merge pull request #7554 from valeriosetti/issue7073-reshape
...
Avoid parse/unparse public ECC keys in PK with USE_PSA when !ECP_C
2023-05-23 15:08:45 +02:00
d6beda7af9
ecp_curves: Extended documentation for CURVE25519.
...
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com >
2023-05-23 09:57:09 +01:00
47249fd9ec
ecp_curves: Added documentation for mbedtls_ecp_mod_p255_raw
...
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com >
2023-05-23 09:57:09 +01:00
31f0b452c7
ecp_curves: Reintroduced input checking for
...
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com >
2023-05-23 09:57:09 +01:00
65c386ee3d
ecp_curves: Switched to dynamic memory for
...
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com >
2023-05-23 09:57:09 +01:00
2daa374ea8
ecp_curves: Minor refactoring of mbedtls_ecp_mod_p255_raw()
...
* Fixed whitespace issues.
* Renamed variables to align with bignum conventions.
* Updated alignment on test input data.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com >
2023-05-23 09:57:09 +01:00
aada68f1be
ecp.py: Fixed types for arguments()
overrides.
...
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com >
2023-05-23 09:57:09 +01:00
c2c967b1f0
ecp.py: Added tests for mbedtls_ecp_mod_p255_raw
...
This patch introduces the `EcpP255Raw` test class for testing
the curve using the preestablished `ecp_mod_p_generic_raw()`
test. The test's logic has been updated accordingly.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com >
2023-05-23 09:57:09 +01:00
2f1ae5a86e
Modify TFM files to allow them to build on baremetal with Mbed TLS and fix code style.
...
Also change the include path of crypto_spe.h in crypto_platform.h to allow the former file to be included in library-only builds.
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com >
2023-05-23 15:40:11 +08:00
16a62e3129
Bring over both necessary medium config files (regular and PSA style) from TFM.
...
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com >
2023-05-23 15:40:11 +08:00
d7d1039755
Merge pull request #7634 from AndrzejKurek/fix-bad-keyfile-prereqs
...
Fix wrong makefile target
2023-05-23 09:27:29 +02:00
7613b3d6b8
Fix xor fail for large block size
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-05-23 08:16:01 +01:00
967b477954
Add test data "modulus-1" and "modulus-2" for every curve
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-23 06:07:32 +00:00
262d8ced79
Fix AES-CBC for in-place operation
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-05-22 23:13:45 +01:00
d0292c2aca
ecp_curves: Refactored mbedtls_ecp_mod_p255
.
...
This patch introduces following methods, as implemented in the
design prototype, and updates them to utilise the _core methods
available for multiplication and addition.
* `mbedtls_ecp_mod_p255()`
* `mbedtls_ecp_mod_p255_raw()`
An entry has been exposed in the `ecp_invasive.h` header
to facilitate testing.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com >
2023-05-22 22:22:32 +01:00
da609130f3
fix: correct calling to time function in tls13 client&server
...
Call `mbedtls_time` to handle the case when MBEDTLS_PLATFORM_TIME_MACRO is defined
Signed-off-by: Yuxiang Cao <yuxiang.cao@fortanix.com >
2023-05-22 13:22:00 -07:00
51cef9ce38
Add missing AES_C dependency in x509 tests
...
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com >
2023-05-22 15:20:48 -04:00
b19b63a639
Changelog update
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-05-22 19:56:03 +01:00
797c4ff365
Make AES-CBC more efficient
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-05-22 19:42:22 +01:00
6f40f8bf01
Add NEON to mbedtls_xor
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-05-22 18:22:07 +01:00
016264b6cb
pk: fix a return value and a typo in comment
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-05-22 18:40:35 +02:00
a7cb845705
pk: add checks for the returned ECC family
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-05-22 18:39:43 +02:00
50729eac74
Merge pull request #7611 from yanrayw/7609_tweak_build_info_include_order
...
build_info.h: fix mutual implications with config_psa.h temporarily
2023-05-22 17:49:55 +02:00
26070670d6
Merge pull request #7565 from gabor-mezei-arm/7263_split_out_Koblitz_raw_functions
...
[Bignum] Split out _raw Koblitz reduction functions
2023-05-22 16:03:17 +01:00
00d55988d9
Fix wrong makefile target
...
Missing tab and a prerequisite that's not a file
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com >
2023-05-22 09:37:55 -04:00
850a0797ca
Remove extraneous check in for loop condition
...
Issue 7529 uncovered an unrequired check in a for loop
condition in ssl_tls.c. This commit removes said check.
Signed-off-by: Thomas Daubney <thomas.daubney@arm.com >
2023-05-22 12:05:03 +01:00
f33b4a5aed
Update comments how to generate the randoms to make it reproducible
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-22 10:55:46 +00:00
37db332658
build_info.h: rewrite comment
...
Signed-off-by: Yanray Wang <yanray.wang@arm.com >
2023-05-22 16:50:39 +08:00
10b6daf755
Fix the comments of sum in ecp function
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-22 02:28:06 +00:00
7f97675b64
Merge pull request #5237 from davidhorstmann-arm/demo-out-of-tree
2023-05-19 21:27:24 +01:00
5e4a01bff5
mbedtls/platform.h: Avoid potential macro redefinition warnings.
...
Some identifiers (e.g. mbedtls_free) can name either functions or
macros depending on configuration settings. For those that turn out
to name macros, first clear out any existing macro definitions to
accommodate possible unconditional bulk symbol renaming. (There
remains no standard provision for such renaming, but it's nevertheless
straightforward enough to do as desired, particularly with this change
in place.)
Signed-off-by: Aaron M. Ucko <ucko@ncbi.nlm.nih.gov >
2023-05-19 10:50:06 -04:00
f57007dd1e
pk: fixing and improving comments
...
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no >
2023-05-19 13:54:39 +02:00
0805ad10b2
XOR perf improvements
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-05-19 11:48:10 +01:00
a23565fd0c
Merge pull request #7621 from daverodgman/sizemax
...
Remove DIY SIZE_MAX definitions
2023-05-19 11:17:38 +01:00
be860a14ce
Generate test data with special seed 2,3,4
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-19 07:39:48 +00:00
bead774daa
Fix the limb mismatch issue on 32-bit platform
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-19 07:39:48 +00:00
6d02c2fefc
Compare the libs of two input value and add comments
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-19 07:39:48 +00:00
c304e53209
Remove useless parameters for ecp_mod_add_sub
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-19 07:39:48 +00:00
61b0c1c3dd
Refine code to align with the styles of ecp_mod_mul_inv
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-19 07:39:48 +00:00
4dd1c0a475
Add test data for ecp_add_sub
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-19 07:39:48 +00:00
9fe2587ccf
Add add_sub test data for named moduli curves
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-19 07:39:48 +00:00
5fc7846507
Add add_sub test cases for named moduli curves
...
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com >
2023-05-19 07:39:48 +00:00
68ef1d6ee6
Remove DIY SIZE_MAX definitions
...
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com >
2023-05-18 20:49:03 +01:00
399fa48e95
Merge pull request #7479 from xkqian/bignumber_test_mul_inv_named_moduli
...
[Bignum] Bignumber test mul inv named moduli
2023-05-18 11:55:01 +01:00
9a11f8a122
Merge pull request #7573 from tom-cosgrove-arm/add-psa_want_alg_some_pake
...
Only include psa_pake_setup() and friends if some PAKE algorithms are required
2023-05-18 09:59:52 +01:00
aa266f29e6
Merge pull request #7602 from mprse/AuthorityKeyId_leak_fix
...
Fix for memory leak while parsing AuthorityKeyId ext
2023-05-18 09:57:56 +01:00