diff options
Diffstat (limited to 'scripts/data_files/driver_jsons')
6 files changed, 204 insertions, 0 deletions
diff --git a/scripts/data_files/driver_jsons/driver_opaque_schema.json b/scripts/data_files/driver_jsons/driver_opaque_schema.json new file mode 100644 index 00000000000..933eb074887 --- /dev/null +++ b/scripts/data_files/driver_jsons/driver_opaque_schema.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "_comment": { + "type": "string" + }, + "prefix": { + "type": "string", + "pattern": "^[A-Z_a-z][0-9A-Z_a-z]*$" + }, + "type": { + "type": "string", + "const": ["opaque"] + }, + "location": { + "type": ["integer","string"], + "pattern": "^(0x|0X)?[a-fA-F0-9]+$" + }, + "mbedtls/h_condition": { + "type": "string" + }, + "headers": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "capabilities": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "_comment": { + "type": "string" + }, + "mbedtls/c_condition": { + "type": "string" + }, + "entry_points": { + "type": "array", + "items": { + "type": "string" + } + }, + "names": { + "type": "object", + "patternProperties": { + "^[A-Z_a-z][0-9A-Z_a-z]*$": { + "type": "string", + "pattern": "^[A-Z_a-z][0-9A-Z_a-z]*$" + } + } + } + }, + "required": [ + "entry_points" + ] + } + ] + } + }, + "required": [ + "prefix", + "type", + "location", + "capabilities" + ] +} diff --git a/scripts/data_files/driver_jsons/driver_transparent_schema.json b/scripts/data_files/driver_jsons/driver_transparent_schema.json new file mode 100644 index 00000000000..f5d91eb321c --- /dev/null +++ b/scripts/data_files/driver_jsons/driver_transparent_schema.json @@ -0,0 +1,70 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "_comment": { + "type": "string" + }, + "prefix": { + "type": "string", + "pattern": "^[A-Z_a-z][0-9A-Z_a-z]*$" + }, + "type": { + "type": "string", + "const": ["transparent"] + }, + "mbedtls/h_condition": { + "type": "string" + }, + "headers": { + "type": "array", + "items": { + "type": "string" + }, + "default": [] + }, + "capabilities": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "_comment": { + "type": "string" + }, + "mbedtls/c_condition": { + "type": "string" + }, + "entry_points": { + "type": "array", + "items": { + "type": "string" + } + }, + "names": { + "type": "object", + "patternProperties": { + "^[A-Z_a-z][0-9A-Z_a-z]*$": { + "type": "string", + "pattern": "^[A-Z_a-z][0-9A-Z_a-z]*$" + } + } + }, + "fallback": { + "type": "boolean", + "default": "false" + } + }, + "required": [ + "entry_points" + ] + } + ] + } + }, + "required": [ + "prefix", + "type", + "capabilities" + ] +} diff --git a/scripts/data_files/driver_jsons/driverlist.json b/scripts/data_files/driver_jsons/driverlist.json new file mode 100644 index 00000000000..42c186adb53 --- /dev/null +++ b/scripts/data_files/driver_jsons/driverlist.json @@ -0,0 +1 @@ +["mbedtls_test_opaque_driver.json","mbedtls_test_transparent_driver.json","p256_transparent_driver.json"] diff --git a/scripts/data_files/driver_jsons/mbedtls_test_opaque_driver.json b/scripts/data_files/driver_jsons/mbedtls_test_opaque_driver.json new file mode 100644 index 00000000000..41c74f2db14 --- /dev/null +++ b/scripts/data_files/driver_jsons/mbedtls_test_opaque_driver.json @@ -0,0 +1,20 @@ +{ + "prefix": "mbedtls_test", + "type": "opaque", + "location": "0x7fffff", + "mbedtls/h_condition": "defined(PSA_CRYPTO_DRIVER_TEST)", + "headers": ["test/drivers/test_driver.h"], + "capabilities": [ + { + "_comment": "The Mbed TLS opaque driver supports import key/export key/export_public key", + "mbedtls/c_condition": "defined(PSA_CRYPTO_DRIVER_TEST)", + "entry_points": ["import_key", "export_key", "export_public_key"] + }, + { + "_comment": "The Mbed TLS opaque driver supports copy key/ get builtin key", + "mbedtls/c_condition": "defined(PSA_CRYPTO_DRIVER_TEST)", + "entry_points": ["copy_key", "get_builtin_key"], + "names": {"copy_key":"mbedtls_test_opaque_copy_key", "get_builtin_key":"mbedtls_test_opaque_get_builtin_key"} + } + ] +} diff --git a/scripts/data_files/driver_jsons/mbedtls_test_transparent_driver.json b/scripts/data_files/driver_jsons/mbedtls_test_transparent_driver.json new file mode 100644 index 00000000000..b9b2d6847e1 --- /dev/null +++ b/scripts/data_files/driver_jsons/mbedtls_test_transparent_driver.json @@ -0,0 +1,22 @@ +{ + "prefix": "mbedtls_test", + "type": "transparent", + "mbedtls/h_condition": "defined(PSA_CRYPTO_DRIVER_TEST)", + "headers": ["test/drivers/test_driver.h"], + "capabilities": [ + { + "_comment": "The Mbed TLS transparent driver supports import key/export key", + "mbedtls/c_condition": "defined(PSA_CRYPTO_DRIVER_TEST)", + "entry_points": ["import_key"], + "fallback": true + }, + { + "_comment": "The Mbed TLS transparent driver supports export_public key", + "mbedtls/c_condition": "defined(PSA_CRYPTO_DRIVER_TEST)", + "entry_points": ["export_public_key"], + "fallback": true, + "names": {"export_public_key":"mbedtls_test_transparent_export_public_key"} + } + + ] +} diff --git a/scripts/data_files/driver_jsons/p256_transparent_driver.json b/scripts/data_files/driver_jsons/p256_transparent_driver.json new file mode 100644 index 00000000000..7d2aabfb3a9 --- /dev/null +++ b/scripts/data_files/driver_jsons/p256_transparent_driver.json @@ -0,0 +1,20 @@ +{ + "prefix": "p256", + "type": "transparent", + "mbedtls/h_condition": "defined(MBEDTLS_PSA_P256M_DRIVER_ENABLED)", + "headers": ["../3rdparty/p256-m/p256-m_driver_entrypoints.h"], + "capabilities": [ + { + "mbedtls/c_condition": "defined(MBEDTLS_PSA_P256M_DRIVER_ENABLED)", + "_comment_entry_points": "This is not the complete list of entry points supported by this driver, only those that are currently supported in JSON. See docs/psa-driver-example-and-guide.md", + "entry_points": ["import_key", "export_public_key"], + "algorithms": ["PSA_ALG_ECDH", "PSA_ALG_ECDSA(PSA_ALG_ANY_HASH)"], + "key_types": [ + "PSA_KEY_TYPE_ECC_KEY_PAIR(PSA_ECC_FAMILY_SECP_R1)", + "PSA_KEY_TYPE_ECC_PUBLIC_KEY(PSA_ECC_FAMILY_SECP_R1)" + ], + "key_sizes": [256], + "fallback": false + } + ] +} |
