Commit graph

24734 commits

Author SHA1 Message Date
Kusumit Ghoderao
10cc6bda1c Add PSA_ALG_PBKDF2_HMAC_GET_HASH macro
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 12:35:14 +05:30
Kusumit Ghoderao
b538bb7a02 Restructure pbkdf2_set_salt function
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 12:32:14 +05:30
Kusumit Ghoderao
e66a8ad8d6 Define PSA_VENDOR_PBKDF2_MAX_ITERATIONS
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 12:30:43 +05:30
Kusumit Ghoderao
52fe517a77 Change pbkdf2 password to array
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-24 12:28:46 +05:30
Kusumit Ghoderao
9016bc4ed2 Clean up commented code
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-08 16:04:05 +05:30
Kusumit Ghoderao
3fc4ca7272 Limit max input cost to 32bit
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-08 15:57:41 +05:30
Kusumit Ghoderao
d0422f30c5 Enable empty salt as input for pbkdf2
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-08 15:56:19 +05:30
Kusumit Ghoderao
6731a2580c Remove redundant code in key_derivation_abort()
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-08 15:54:54 +05:30
Kusumit Ghoderao
b9410e89b4 Fix failing CI
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-04 13:17:51 +05:30
Kusumit Ghoderao
056f0c5047 Make output_byte return not_supported for pbkdf2
As output functionality is not added yet return PSA_SUCCESS for
now if inputs are passed correctly. If input validation fails
operation is aborted and output_bytes will return PSA_ERROR_BAD_STATE

Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 17:33:27 +05:30
Kusumit Ghoderao
7c05c00988 Add test cases for pbkdf2 input functions
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:37 +05:30
Kusumit Ghoderao
f5fedf1e0d Add pbkdf2 to psa_key_derivation_abort
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:37 +05:30
Kusumit Ghoderao
3128c5d9ce Enable can_output_key with PSA_KEY_DERIVATION_INPUT_PASSWORD
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:37 +05:30
Kusumit Ghoderao
24b3895dee Add pbkdf2 input functions to psa_key_derivation_input_internal
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:36 +05:30
Kusumit Ghoderao
f4fe3ee9e4 Add input password function for pbkdf2
Also adds PSA_KEY_DERIVATION_INPUT_PASSWORD case handling to
psa_key_derivation_check_input_type function

Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:36 +05:30
Kusumit Ghoderao
547a6c6fd1 add input salt function for pbkdf2
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:36 +05:30
Kusumit Ghoderao
944bba1e30 Add input cost function for pbkdf2
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:36 +05:30
Kusumit Ghoderao
d132cacb38 Add pbkdf2_hmac to is_kdf_alg_supported()
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:35 +05:30
Kusumit Ghoderao
af0b534256 Add pbkdf2 to ATLEAST_ONE_BUILTIN_KDF definition
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:35 +05:30
Kusumit Ghoderao
dcfa548293 Add pbkdf2 to key_derivation context struct
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:35 +05:30
Kusumit Ghoderao
30ced52497 Add pbkdf2 struct to crypto_builtin_key_derivation.h
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:35 +05:30
Kusumit Ghoderao
876e2c2424 Add psa_pbkdf2_key_derivation_state_t
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:34 +05:30
Kusumit Ghoderao
83baf8968d Add builtin PBKDF2_HMAC definition in config_psa.h
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:34 +05:30
Kusumit Ghoderao
aca31654e6 Enable PSA_WANT_ALG_PBKDF2_HMAC in crypto_config.h
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-03 14:20:34 +05:30
Gilles Peskine
d3ca5e5897
Merge pull request #7328 from mprse/ec-jpake-fix1
Fix the JPAKE driver interface for user+peer
2023-05-02 20:42:25 +02:00
Gilles Peskine
c70d9eab8a
Merge pull request #7412 from silabs-Kusumit/PBKDF2_implementation
PBKDF2: Implement input_integer
2023-05-02 20:41:23 +02:00
Manuel Pégourié-Gonnard
8e076e4132
Merge pull request #6915 from aditya-deshpande-arm/example-driver-post-codestyle
Document (with examples) how to integrate a third-party driver with Mbed TLS
2023-05-02 12:13:42 +02:00
Manuel Pégourié-Gonnard
f317df98ea
Merge pull request #7461 from valeriosetti/issue7460-part1
Fixing USE_PSA_INIT/DONE in SSL/X509/PK test suites
2023-05-02 10:44:13 +02:00
Kusumit Ghoderao
d60dfc0e43 Add test for parse_binary_string
Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
2023-05-02 10:47:50 +05:30
Aditya Deshpande
8225587fd7 Change from Mbed TLS 3.3.0 to 3.4.0 in driver documentation.
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:55:02 +01:00
Aditya Deshpande
641cb8914d Minor changes to documentation and code comments for clarity
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:55:02 +01:00
Aditya Deshpande
7b9934dcdd Add support for building p256-m alongside Mbed TLS with CMake.
Also check if p256-m is enabled in the config before including the contents of p256-m.c

Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:55 +01:00
Aditya Deshpande
ac363d8d20 Migrate p256-m_driver_entrypoints.[hc] to new code style
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
ebd624e691 Minor formatting change to driver wrapper jinja template
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
f100f00679 Add warnings to documentation stating that p256-m code may be out of date with upstream, plus other minor grammatical fixes.
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
be55bb2d5d Use psa_generate_random() instead of mbedtls_ctr_dbrg
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
8d99f2590c Add 3rdparty license information to the README
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
045b370c66 Add SPDX license identifiers to driver entry point files
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
a8d663d3af Add README and license from the p256-m repo
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
bac592d53e Remove rand() from p256_generate_random() and move to an implementation based on mbedtls_ctr_drbg
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
caed18e741 Add README in p256-m/
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
a9612d00a4 Remove unnecessary no-check-names comments
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
f80b939096 Add information for driver points where auto-generation is implemented
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
755b174fec Add example for integrating a driver alongside Mbed TLS for entrypoints where auto-generation of driver wrappers is not implemented yet.
Using p256-m as the example driver/software accelerator.

Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
695e44b5a0 Rename p256m to p256 for uniform function/macro prefixes
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
abf4bf31cb Start the driver example write-up (p256-m integration)
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
277690e944 Add step-by-step guide for writing and integrating drivers for entry points where auto-generation is not implemented
Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:15 +01:00
Aditya Deshpande
e41f7e457f Integrate p256-m as an example driver alongside Mbed TLS and write documentation for the example.
(Reapplying changes as one commit on top of development post codestyle change instead of rewriting old branch)

Signed-off-by: Aditya Deshpande <aditya.deshpande@arm.com>
2023-04-28 17:54:09 +01:00
Gilles Peskine
14d6b1124b
Merge pull request #7419 from yuhaoth/test/random-time-test-fail
Workaround random `test_suite_platform` fail in time test
2023-04-28 13:17:31 +02:00
Gilles Peskine
7351101704
Merge pull request #7502 from daverodgman/inline-clz
Fix VS2022 build error
2023-04-28 13:06:47 +02:00