Commit graph

11020 commits

Author SHA1 Message Date
Dave Rodgman
b6e06549f5 Rename MULADDC_PRESERVE_R1 etc to MULADDC_PRESERVE_SCRATCH etc
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-06-04 20:42:17 -04:00
Dave Rodgman
f89e3c5fbd Improve docs & check for non-gcc compilers
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-06-04 20:41:52 -04:00
Dave Rodgman
6df1e54c1d Do not use assembly on Thumb 1 / clang
Signed-off-by: Dave Rodgman <dave.rodgman@gmail.com>
2023-06-02 13:51:31 -04:00
Dave Rodgman
3964fe0f5e Improve ISA detection
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-25 18:53:57 +01:00
Dave Rodgman
12b14b2c97 Simplify ifdefs
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-25 13:02:13 +01:00
Dave Rodgman
b047bf64e2 Restrict use of r7 in Thumb 1 code
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-25 12:54:56 +01:00
Dave Rodgman
cee166e3f5 Don't use r7 in generic codepath
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-25 11:00:05 +01:00
Dave Rodgman
7d6ec95517 Revert to detecting __GNUCC__ instead of armclang
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-25 09:41:42 +01:00
Dave Rodgman
92e8a88390 Improve comments
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-25 08:10:33 +01:00
Dave Rodgman
5c5a6dece6 Give options clearer names
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-24 23:24:16 +01:00
Dave Rodgman
6adaca6062 Minor tidy-up
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-24 19:53:21 +01:00
Dave Rodgman
ffbb7c5edc Tidy-up macros and fix guards around option B
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-24 18:28:46 +01:00
Dave Rodgman
1416cba81f Gate all arm asm on Armv6 or better architecture
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-24 18:07:48 +01:00
Dave Rodgman
0ffc6f48fa First draft at fixing the choice of asm
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-24 17:19:10 +01:00
Dave Rodgman
4489c8dcef Disable bignum assembly for certain Arm M-class CPUs
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-24 12:06:48 +01:00
Dave Rodgman
2b22834357
Merge pull request #7644 from tom-daubney-arm/alignment_h_refactoring
Refactor reading of multi-byte values using functions in alignment.h
2023-05-24 08:32:52 +01:00
Thomas Daubney
f9f0ba8211 Use functions in alignment.h to get value
Refactor code using get functions from alignment.h to
read values.

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
2023-05-24 06:24:16 +01:00
Manuel Pégourié-Gonnard
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
Valerio Setti
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
Valerio Setti
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
Paul Elliott
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
Valerio Setti
f57007dd1e pk: fixing and improving comments
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-19 13:54:39 +02:00
Dave Rodgman
68ef1d6ee6 Remove DIY SIZE_MAX definitions
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-18 20:49:03 +01:00
Paul Elliott
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
Paul Elliott
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
Dave Rodgman
e4cbab6945
Merge pull request #7607 from daverodgman/pr6511 2023-05-17 19:11:56 +01:00
Paul Elliott
8203f2d89f
Merge pull request #7535 from minosgalanakis/ecp/7264_enable_core_shift_l
[Bignum] Adjust mbedtls_mpi_core_shift_l to use the core function
2023-05-17 18:45:44 +01:00
Valerio Setti
c1541cb3c7 pk: minor fixes (guards and a wrong assignment)
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 19:23:02 +02:00
Gabor Mezei
d56e6e008b
Add input parameter length check for the Koblitz reduction
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-05-17 17:51:19 +02:00
Gabor Mezei
fa3f74145b
Add documentation
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-05-17 17:35:47 +02:00
Valerio Setti
483738ed67 tests: fixes for using the new public key raw format
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 15:38:39 +02:00
Valerio Setti
d7ca39511f tls12: use the the raw format for the public key when USE_PSA is enabled
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 15:36:18 +02:00
Valerio Setti
7ca7b90bc7 debug: add support for printing the new EC raw format
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 15:35:46 +02:00
Valerio Setti
a1b8af6869 pkwrap: update ECDSA verify and EC pair check to use the new public key
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 15:34:57 +02:00
Valerio Setti
4064dbbdb2 pk: update pkparse and pkwrite to use the new public key storing solution
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 15:33:07 +02:00
Valerio Setti
722f8f7472 pk: adding a new field to store the public key in raw format
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 15:31:21 +02:00
Valerio Setti
4ac9d44d83 pk: fix typos in description of mbedtls_pk_ec_[ro/rw]
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
2023-05-17 12:32:13 +02:00
Manuel Pégourié-Gonnard
b1c0afe484
Merge pull request #7595 from valeriosetti/deprecate_pk_ec
Set mbedtls_pk_ec() as internal function when ECP_C is not defined
2023-05-17 12:27:03 +02:00
Minos Galanakis
0144b35f7d bignum: Updated mbedtls_mpi_shift_l to use the core method.
Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
2023-05-16 17:16:26 +01:00
Paul Elliott
f0806bee66
Merge pull request #7489 from minosgalanakis/ecp/7246_xtrack_core_shift_l
[Bignum]: Introduce left shift from prototype
2023-05-16 17:13:19 +01:00
Dave Rodgman
8508e50d3d Make use of MBEDTLS_STATIC_ASSERT
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-16 16:43:48 +01:00
Dave Rodgman
ed59ea76a6 Document minimum size for DEBUG_BUF_SIZE
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-16 16:42:40 +01:00
valord577
5bfcd1c63b simplify code
Signed-off-by: valord577 <valord577@gmail.com>
2023-05-16 16:42:40 +01:00
valord577
176e92711c code style
Signed-off-by: valord577 <valord577@gmail.com>
2023-05-16 16:42:40 +01:00
valord577
536893c22f make code readable and change var name
Signed-off-by: valord577 <valord577@gmail.com>
2023-05-16 16:42:40 +01:00
valord577
24da0cd0f9 send debug msg if contains '\n'
Signed-off-by: valord577 <valord577@gmail.com>
2023-05-16 16:42:40 +01:00
Dave Rodgman
9ecf5f96df Update library/debug.c
Fix trailing white-space

Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
2023-05-16 16:42:40 +01:00
valord577
25418ac734 Fix: no newline when debug msg over DEBUG_BUF_SIZE
Signed-off-by: valord577 <valord577@gmail.com>
2023-05-16 16:42:40 +01:00
Gabor Mezei
caac83c517
Fix comment
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-05-16 17:41:26 +02:00
Gabor Mezei
03558b847e
Add _raw function to P256K1
Modified the testing to use the generic fast reduction test function.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
2023-05-16 17:30:03 +02:00