Skip to content

Commit 3a06eed

Browse files
authored
Merge pull request Mbed-TLS#15 from ronald-cron-arm/comparison-with-mbedcrypto
Add comparison with Mbed TLS crypto library documentation
2 parents 3fddf15 + 99632b3 commit 3a06eed

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

docs/architecture/psa-crypto-repository.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,3 +196,33 @@ of the commit identifiers are used.
196196
* git commit -s -m"Update against \<mbedtls-commit-id\>(PR \<mbedtls-pr\>) with \<psa-crypto-commit-id\>"
197197
* Create a PR against the main branch with the branch that has just been created.
198198
* Merge the PR which completes the update.
199+
200+
## Comparison with the Mbed TLS cryptography library
201+
202+
The PSA-Crypto library does not support all the cryptographic features
203+
that the Mbed TLS cryptographic library supports, the main area of discrepancy
204+
being the handling of the various formats of private and public asymmetric
205+
keys.
206+
207+
To be more specific, the following Mbed TLS C modules can be potentially
208+
included in the Mbed TLS cryptography library but not in the PSA-Crypto one:
209+
. nist_kw.c
210+
. pem.c
211+
. pkcs5.c
212+
. pkcs7.c
213+
. pkcs12.c
214+
215+
Furthermore, the following Mbed TLS C modules can be potentially included in
216+
the PSA-Crypto library as the builtin driver implementation relies on them but
217+
their interface is not public and thus may change without notice:
218+
. asn1parse.c
219+
. asn1write.c
220+
. oid.c
221+
. pk.c
222+
. pkparse.c
223+
. pkwrite.c
224+
225+
Otherwise, the PSA-Crypto library does not have support for alternative
226+
implementations of cryptography operations as Mbed TLS does through
227+
MBEDTLS_xxx_ALT like configuration options. Alternative implementations should
228+
instead be provided as PSA drivers.

scripts/psa_crypto.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ def copy_of_mbedtls_headers(mbedtls_root_path, psa_crypto_root_path):
3939
destination_path = os.path.join(builtin_path, "include", "mbedtls")
4040

4141
include_files = filter(lambda file_: not re.match(
42-
"x509.*|mps.*|ssl.*|\.gitignore|debug\.h|net_sockets\.h", file_),
42+
"x509.*|mps.*|ssl.*|base64\.*|nist_kw\.*|pem\.*|padlock\.*|pkcs.*|"\
43+
"\.gitignore|debug\.h|net_sockets\.h"\
44+
"", file_),
4345
os.listdir(source_path))
4446
for file_ in include_files:
4547
shutil.copy2(os.path.join(source_path, file_), destination_path)
@@ -52,7 +54,8 @@ def copy_of_mbedtls_headers(mbedtls_root_path, psa_crypto_root_path):
5254
def copy_from_library(mbedtls_root_path, psa_crypto_root_path):
5355
builtin_path = os.path.join(psa_crypto_root_path, "drivers", "builtin")
5456
library_files = filter(lambda file_: not re.match(
55-
".*\.o|x509.*|mps.*|ssl.*|\.gitignore|Makefile|CMakeLists\.txt|"\
57+
".*\.o|x509.*|mps.*|ssl.*|base64\.*|nist_kw\.*|pem\.*|padlock\.*|pkcs.*|"\
58+
"\.gitignore|Makefile|CMakeLists\.txt|"\
5659
"debug\.c|error\.c|net_sockets\.c"\
5760
"psa_crypto_core_common\.h", file_),
5861
os.listdir(os.path.join(mbedtls_root_path, "library")))

0 commit comments

Comments
 (0)