Mbed-TLS / mbedtls

An open source, portable, easy to use, readable and flexible TLS library, and reference implementation of the PSA Cryptography API. Releases are on a varying cadence, typically around 3 - 6 months between releases.
https://www.trustedfirmware.org/projects/mbed-tls/
Other
5.54k stars 2.6k forks source link

Investigate generating driver wrapper tests in a systematic way #4463

Open gilles-peskine-arm opened 3 years ago

gilles-peskine-arm commented 3 years ago

The driver wrapper test cases (tests/suites/test_suite_psa_crypto_driver_wrappers.data) are written in a fairly systematic way: enumerate functions that have a driver interface, and invoke them with a representative selection of algorithms and key types. They are candidates for automatic generation.

Many of them are known-answer tests, so crypto_knowledge.py would need to be extended with known (input, answer) data. This data could in turn be used to test the core as well: it would give us a minimum set of known-answer test, so we could focus the manually written test cases on large data sets and edge cases.

This is an investigation task. The goal is to determine the feasibility, and if feasible, to define tasks of manageable size for the execution.

gilles-peskine-arm commented 2 years ago

Instead of populating crypto_knowledge.py with known answers, we could use Cryptodome to generate those answers on the fly, as in https://github.com/ARMmbed/mbedtls/pull/5218.