-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[crypto] Initial crypto backend using PSA crypto API #23193
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pullapprove
bot
requested review from
anush-apple,
arkq,
Byungjoo-Lee,
bzbarsky-apple,
carol-apple,
chrisdecenzo,
chshu,
chulspro,
dhrishi,
electrocucaracha,
emargolis,
erjiaqing,
franck-apple,
gjc13,
harsha-rajendran,
hawk248,
isiu-apple,
jelderton,
jepenven-silabs,
jmartinez-silabs,
jtung-apple,
kghost,
lazarkov,
LuDuda,
mlepage-google,
mrjerryjohns,
msandstedt,
mspang,
rgoliver and
robszewczyk
October 14, 2022 09:39
pullapprove
bot
requested review from
saurabhst,
selissia,
tecimovic,
turon,
vijs,
vivien-apple,
wbschiller,
woody-apple,
xylophone21 and
yunhanw-google
October 14, 2022 09:39
Damian-Nordic
changed the title
[crypto] Add initial implementation for PSA crypto API
[crypto] Initial crypto backend using PSA crypto API
Oct 14, 2022
Damian-Nordic
force-pushed
the
psa-upstream
branch
from
October 14, 2022 10:11
7089e85
to
2f75489
Compare
PR #23193: Size comparison from bc6b438 to 2f75489 Increases (4 builds for cc13x2_26x2, esp32, psoc6, telink)
Decreases (10 builds for bl602, bl702, cc13x2_26x2, psoc6, telink)
Full report (38 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
emargolis
approved these changes
Oct 14, 2022
Implement most cryptographic operations using PSA crypto API. Make it unit-testable using the following manual steps (until we all agree to update mbedTLS to 3.X): 1. Update mbedTLS submodule to 3.2.1 and update mbedtls.gni accordingly. 2. Use scripts/generate_driver_wrappers.py to generate psa_crypto_driver_wrappers.c and include it in mbedTLS library build. 3. Increase CHIP_CONFIG_SHA256_CONTEXT_SIZE to 256B 4. gn gen out/ut --args='chip_crypto="psa"' 5. ninja -C out/ut tests/CHIPCryptoPALTest 6. out/ut/tests/CHIPCryptoPALTest [crypto] Implement PBKDF2 using PSA crypto API PBKDF2 PSA crypto API is not yet implemented in mbedTLS 3.1 nor 3.2 so for now use a handcrafted implementation using HMAC directly. [crypto] Implement ECDSA and ECDH using PSA crypto API The ECDSA and ECDH operations specified by P256Keypair and P256PublicKey classes have been implemented using PSA crypto API provided by mbedTLS 3.X.
Damian-Nordic
force-pushed
the
psa-upstream
branch
from
October 17, 2022 14:49
2f75489
to
41778cc
Compare
PR #23193: Size comparison from 9f08fc1 to 41778cc Increases (3 builds for cc13x2_26x2, esp32, psoc6)
Decreases (6 builds for bl602, bl702, cc13x2_26x2, esp32, psoc6, telink)
Full report (38 builds for bl602, bl702, cc13x2_26x2, cyw30739, efr32, esp32, k32w, linux, mbed, nrfconnect, psoc6, qpg, telink)
|
adbridge
pushed a commit
to ARM-software/connectedhomeip
that referenced
this pull request
Nov 18, 2022
) * [crypto] Add initial implementation for PSA crypto API Implement most cryptographic operations using PSA crypto API. Make it unit-testable using the following manual steps (until we all agree to update mbedTLS to 3.X): 1. Update mbedTLS submodule to 3.2.1 and update mbedtls.gni accordingly. 2. Use scripts/generate_driver_wrappers.py to generate psa_crypto_driver_wrappers.c and include it in mbedTLS library build. 3. Increase CHIP_CONFIG_SHA256_CONTEXT_SIZE to 256B 4. gn gen out/ut --args='chip_crypto="psa"' 5. ninja -C out/ut tests/CHIPCryptoPALTest 6. out/ut/tests/CHIPCryptoPALTest [crypto] Implement PBKDF2 using PSA crypto API PBKDF2 PSA crypto API is not yet implemented in mbedTLS 3.1 nor 3.2 so for now use a handcrafted implementation using HMAC directly. [crypto] Implement ECDSA and ECDH using PSA crypto API The ECDSA and ECDH operations specified by P256Keypair and P256PublicKey classes have been implemented using PSA crypto API provided by mbedTLS 3.X. * Code review comments
adbridge
pushed a commit
to ARM-software/connectedhomeip
that referenced
this pull request
Nov 18, 2022
) * [crypto] Add initial implementation for PSA crypto API Implement most cryptographic operations using PSA crypto API. Make it unit-testable using the following manual steps (until we all agree to update mbedTLS to 3.X): 1. Update mbedTLS submodule to 3.2.1 and update mbedtls.gni accordingly. 2. Use scripts/generate_driver_wrappers.py to generate psa_crypto_driver_wrappers.c and include it in mbedTLS library build. 3. Increase CHIP_CONFIG_SHA256_CONTEXT_SIZE to 256B 4. gn gen out/ut --args='chip_crypto="psa"' 5. ninja -C out/ut tests/CHIPCryptoPALTest 6. out/ut/tests/CHIPCryptoPALTest [crypto] Implement PBKDF2 using PSA crypto API PBKDF2 PSA crypto API is not yet implemented in mbedTLS 3.1 nor 3.2 so for now use a handcrafted implementation using HMAC directly. [crypto] Implement ECDSA and ECDH using PSA crypto API The ECDSA and ECDH operations specified by P256Keypair and P256PublicKey classes have been implemented using PSA crypto API provided by mbedTLS 3.X. * Code review comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement most cryptographic operations using PSA crypto API (remaining ones will probably keep using old mbedTLS APIs).
Make it unit-testable using the following manual steps (until we all agree to update mbedTLS to 3.X):
mbedtls.gni
accordingly.scripts/generate_driver_wrappers.py
to generatepsa_crypto_driver_wrappers.c
and include it in mbedTLS library build.CHIP_CONFIG_SHA256_CONTEXT_SIZE
to 256Bgn gen out/ut --args='chip_crypto="psa"'
ninja -C out/ut tests/CHIPCryptoPALTest
out/ut/tests/CHIPCryptoPALTest
Note that the first 3 steps are done on my private branch: Damian-Nordic@1e9201d.
Fixes #23188