Draft
Conversation
Doing this since psa does not support compressed form. This has an overhead of around 14KB due to pulling the p256 crate.
Collaborator
Author
|
Oh, I was too happy when the local tests passed, but the actual compilation for the embedded target failed. Seems to be an issue with building mbedtls. |
Collaborator
Author
|
Good news -- I was able to compile and run on the nRF52840. Bad news -- diff --git a/scripts/config.py b/scripts/config.py
index 6d5edc7c0..36312df04 100755
--- a/scripts/config.py
+++ b/scripts/config.py
@@ -241,6 +241,7 @@ def full_adapter(name, active, section):
# need to be repeated here.
EXCLUDE_FROM_BAREMETAL = frozenset([
#pylint: disable=line-too-long
+ 'MBEDTLS_PSA_CRYPTO_BUILTIN_KEYS',
'MBEDTLS_ENTROPY_NV_SEED', # requires a filesystem and FS_IO or alternate NV seed hooks
'MBEDTLS_FS_IO', # requires a filesystem
'MBEDTLS_HAVE_TIME', # requires a clock
@@ -270,6 +271,20 @@ def baremetal_adapter(name, active, section):
if name == 'MBEDTLS_NO_PLATFORM_ENTROPY':
# No OS-provided entropy source
return True
+ if name == 'MBEDTLS_ENTROPY_HARDWARE_ALT':
+ # Custom entropy source provided
+ return True
+ if name == 'MBEDTLS_ENTROPY_FORCE_SHA256':
+ # Force SHA-256 accumulator
+ return True
+ if name == 'MBEDTLS_MEMORY_BUFFER_ALLOC_C':
+ return True
+ if name == 'MBEDTLS_PLATFORM_C':
+ return True
+ if name == 'MBEDTLS_PLATFORM_MEMORY':
+ return True
+ if name == 'MBEDTLS_PLATFORM_NO_STD_FUNCTIONS':
+ return True
return include_in_full(name) and keep_in_baremetal(name)
def include_in_crypto(name): |
This file contains hidden or 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
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.
The approach is twofold:
no-stdandbaremetalfeatures (no patches at thembedtlslevel). I hope to be able to merge that upstream, so that we can use the vanilla psa wrapper.Reasoning behind this PR:
extractandexpand, and manually decompressing public keys using a third party library.rustcryptoseems to depend on RIOT for the RNG).Edit: possible upstream
no-stdfeature forcrypto-psatracked here.