/mbedtls-3.5.0/tests/suites/ |
D | test_suite_psa_crypto_persistent_key.data | 2 # stored, this may indicate that the key store is changing in a 6 Format for storage: RSA private key 9 Format for storage: AES-128 key 12 Parse storage: RSA private key 15 Parse storage: AES-128 key 33 Parse storage: truncated key 37 Save maximum-size persistent raw key 41 Save larger than maximum-size persistent raw key 44 Persistent key destroy 48 Persistent key destroy after restart [all …]
|
D | test_suite_x509write.data | 3 x509_csr_check:"data_files/server1.key":"data_files/server1.req.sha1":MBEDTLS_MD_SHA1:0:0:0:0:0 7 x509_csr_check:"data_files/server1.key":"data_files/server1.req.sha224":MBEDTLS_MD_SHA224:0:0:0:0:0 11 x509_csr_check:"data_files/server1.key":"data_files/server1.req.sha256":MBEDTLS_MD_SHA256:0:0:0:0:0 15 x509_csr_check:"data_files/server1.key":"data_files/server1.req.sha384":MBEDTLS_MD_SHA384:0:0:0:0:0 19 x509_csr_check:"data_files/server1.key":"data_files/server1.req.sha512":MBEDTLS_MD_SHA512:0:0:0:0:0 23 x509_csr_check:"data_files/server1.key":"data_files/server1.req.md5":MBEDTLS_MD_MD5:0:0:0:0:0 27 x509_csr_check:"data_files/server1.key":"data_files/server1.req.key_usage":MBEDTLS_MD_SHA1:MBEDTLS_… 31 x509_csr_check_opaque:"data_files/server1.key":MBEDTLS_MD_SHA1:MBEDTLS_X509_KU_DIGITAL_SIGNATURE | … 35 x509_csr_check:"data_files/server1.key":"data_files/server1.req.key_usage_empty":MBEDTLS_MD_SHA1:0:… 39 x509_csr_check:"data_files/server1.key":"data_files/server1.req.cert_type":MBEDTLS_MD_SHA1:0:0:MBED… [all …]
|
D | test_suite_nist_kw.function | 21 unsigned char key[16]; 30 memset(key, 0, sizeof(key)); 40 key, sizeof(key) * 8, 51 key, sizeof(key) * 8, 75 key, sizeof(key) * 8, 93 key, sizeof(key) * 8, 129 unsigned char key[32]; 134 memset(key, 0x2A, sizeof(key)); 135 TEST_ASSERT((unsigned) key_size <= 8 * sizeof(key)); 137 ret = mbedtls_nist_kw_setkey(&ctx, cipher_id, key, key_size, is_wrap); [all …]
|
D | test_suite_psa_crypto_se_driver_hal_mocks.data | 13 SE key importing mock test 16 SE key importing mock test: max key bits 19 SE key importing mock test: more than max key bits 22 SE key importing mock test: alloc failed 25 SE key importing mock test: import failed 28 SE key exporting mock test 31 SE key exporting mock test: export failed 34 SE public key exporting mock test 37 SE public key exporting mock test: export failed 40 SE key generating mock test [all …]
|
D | test_suite_pkwrite.data | 1 Public key write check RSA 5 Public key write check RSA 4096 9 Public key write check EC 192 bits 13 Public key write check EC 521 bits 17 Public key write check EC Brainpool 512 bits 21 Private key write check RSA 23 pk_write_key_check:"data_files/server1.key" 25 Private key write check RSA 4096 29 Private key write check EC 192 bits 33 Private key write check EC 256 bits (top bit set) [all …]
|
D | test_suite_lmots.data | 2 # This test uses a fixed message, and then generates a private key, signs the 7 # This test uses a fixed message, and then generates a private key, signs the 12 # This test uses a NULL zero-length message, and then generates a private key, 20 # key is stored in data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv. 21 # This test uses the same OTS key as the LMS hsslms interop test 1 (leaf 0 of 22 # the LMS key), and the same message. 24 # To produce another signature with this message and key (note that the actual 45 # key is stored in data_files/lms_hsslms_sha256_m32_h5_lmots_sha256_n32_w8_prv. 46 # This test uses the same OTS key as the LMS hsslms interop test 2 (leaf 1 of 47 # the LMS key), and the same message. [all …]
|
D | test_suite_psa_crypto_slot_management.function | 8 /**< Close key(s) */ 11 /**< Destroy key(s) */ 14 /**< Purge key(s) */ 20 /**< Close key(s) then terminate and re-initialize */ 23 /**< Destroy key(s) then terminate and re-initialize */ 26 /**< Purge key(s) then terminate and re-initialize */ 43 /** Apply \p invalidate_method to invalidate the specified key: 47 mbedtls_svc_key_id_t key) 50 /* Closing the key invalidate only volatile keys, not persistent ones. */ 53 PSA_ASSERT(psa_close_key(key)); [all …]
|
D | test_suite_lms.data | 2 # This test uses a fixed message, and then generates a private key, signs the 7 # This test uses a NULL zero-length message, and then generates a private key, 13 # limited amount of available test vectors for LMS. The private key is stored in 15 # uses leaf key 0, so must be the first signature generated by the key if the 18 # word at the start of the key/sig. We strip these 4 bytes from the signature 19 # and the public key before including them in a the test data. 21 # To produce another signature with this message and key (note that the actual 39 # The signature uses leaf key 1, so must be the second signature generated by 40 # the key if the signature is to be reproduced. 42 # To produce another signature with this message and key (note that the actual [all …]
|
D | test_suite_psa_crypto.data | 55 PSA import AES: bad key size 59 PSA import/export RSA public key: good, 1024-bit 63 PSA import/export RSA public key: good, larger buffer (+1 byte) 67 PSA import/export RSA public key: good, larger buffer (*2-1) 71 PSA import/export RSA public key: good, larger buffer (*2) 75 PSA import/export RSA public key: good, larger buffer (*2+1) 79 PSA import/export RSA public key: export buffer too small 111 PSA import/export RSA public key: good, 1024-bit, opaque 115 PSA import/export RSA public key: good, larger buffer (+1 byte), opaque 119 PSA import/export RSA public key: good, larger buffer (*2-1), opaque [all …]
|
D | test_suite_ccm.function | 6 * The context must have been set up with the key. */ 80 unsigned char key[32]; 85 memset(key, 0x2A, sizeof(key)); 86 TEST_ASSERT((unsigned) key_size <= 8 * sizeof(key)); 88 ret = mbedtls_ccm_setkey(&ctx, cipher_id, key, key_size); 100 unsigned char key[16]; 111 memset(key, 0, sizeof(key)); 118 key, 8 * sizeof(key)) == 0); 143 unsigned char key[16]; 153 memset(key, 0, sizeof(key)); [all …]
|
D | test_suite_psa_crypto.function | 42 mbedtls_svc_key_id_t key, 52 PSA_ASSERT(psa_pake_set_password_key(operation, key)); 138 * Or, for a public key, the same structure with only 181 mbedtls_svc_key_id_t key = MBEDTLS_SVC_KEY_ID_INIT; 187 PSA_ASSERT(psa_import_key(&attributes, key_bytes, key_length, &key)); 189 *status = psa_mac_sign_setup(operation, key, alg); 195 TEST_EQUAL(psa_mac_sign_setup(operation, key, alg), *status); 198 psa_destroy_key(key); 202 psa_destroy_key(key); 213 mbedtls_svc_key_id_t key = MBEDTLS_SVC_KEY_ID_INIT; [all …]
|
D | test_suite_psa_crypto_attributes.data | 1 PSA key attributes structure 5 PSA key attributes: id only 8 PSA key attributes: lifetime=3 only 11 PSA key attributes: id then back to volatile 14 PSA key attributes: id then back to non local volatile 17 PSA key attributes: id then lifetime 20 PSA key attributes: lifetime then id 23 PSA key attributes: non local volatile lifetime then id 26 PSA key attributes: slot number
|
/mbedtls-3.5.0/docs/architecture/ |
D | mbed-crypto-storage-specification.md | 26 * [Persistent transparent keys](#key-file-format-for-0.1.0) designated by a [slot number](#key-name… 33 We do not make any promises regarding key storage, or regarding the nonvolatile random seed file on… 37 …key is stored in a dedicated file whose name is constructed from the key identifier. The way in wh… 39 The valid values for a key identifier are the range from 1 to 0xfffeffff. This limitation on the ra… 51 The layout of a key file is: 58 * key material length (4 bytes) 59 * key material: output of `psa_export_key` 73 … 1 through 0xfffeffff: [content](#key-file-format-for-0.1.0) of the [key whose identifier is the f… 81 …time configuration value `CRYPTO_STORAGE_FILE_LOCATION` allows storing the key files in a director… 84 …ATION "psa_key_slot_%lu", key_id)` [content](#key-file-format-for-0.1.0) of the [key whose identif… [all …]
|
/mbedtls-3.5.0/library/ |
D | ssl_ticket.c | 75 mbedtls_ssl_ticket_key *key = ctx->keys + index; in ssl_ticket_gen_key() local 82 key->generation_time = mbedtls_time(NULL); in ssl_ticket_gen_key() 85 if ((ret = ctx->f_rng(ctx->p_rng, key->name, sizeof(key->name))) != 0) { in ssl_ticket_gen_key() 96 psa_set_key_algorithm(&attributes, key->alg); in ssl_ticket_gen_key() 97 psa_set_key_type(&attributes, key->key_type); in ssl_ticket_gen_key() 98 psa_set_key_bits(&attributes, key->key_bits); in ssl_ticket_gen_key() 102 PSA_BITS_TO_BYTES(key->key_bits), in ssl_ticket_gen_key() 103 &key->key)); in ssl_ticket_gen_key() 106 ret = mbedtls_cipher_setkey(&key->ctx, buf, in ssl_ticket_gen_key() 107 mbedtls_cipher_get_key_bitlen(&key->ctx), in ssl_ticket_gen_key() [all …]
|
D | cipher_wrap.c | 185 static int aes_setkey_dec_wrap(void *ctx, const unsigned char *key, in aes_setkey_dec_wrap() argument 188 return mbedtls_aes_setkey_dec((mbedtls_aes_context *) ctx, key, key_bitlen); in aes_setkey_dec_wrap() 191 static int aes_setkey_enc_wrap(void *ctx, const unsigned char *key, in aes_setkey_enc_wrap() argument 194 return mbedtls_aes_setkey_enc((mbedtls_aes_context *) ctx, key, key_bitlen); in aes_setkey_enc_wrap() 417 static int xts_aes_setkey_enc_wrap(void *ctx, const unsigned char *key, in xts_aes_setkey_enc_wrap() argument 421 return mbedtls_aes_xts_setkey_enc(xts_ctx, key, key_bitlen); in xts_aes_setkey_enc_wrap() 424 static int xts_aes_setkey_dec_wrap(void *ctx, const unsigned char *key, in xts_aes_setkey_dec_wrap() argument 428 return mbedtls_aes_xts_setkey_dec(xts_ctx, key, key_bitlen); in xts_aes_setkey_dec_wrap() 505 static int gcm_aes_setkey_wrap(void *ctx, const unsigned char *key, in gcm_aes_setkey_wrap() argument 509 key, key_bitlen); in gcm_aes_setkey_wrap() [all …]
|
D | des.c | 324 void mbedtls_des_key_set_parity(unsigned char key[MBEDTLS_DES_KEY_SIZE]) in mbedtls_des_key_set_parity() 329 key[i] = odd_parity_table[key[i] / 2]; in mbedtls_des_key_set_parity() 336 int mbedtls_des_key_check_key_parity(const unsigned char key[MBEDTLS_DES_KEY_SIZE]) in mbedtls_des_key_check_key_parity() 341 if (key[i] != odd_parity_table[key[i] / 2]) { in mbedtls_des_key_check_key_parity() 393 int mbedtls_des_key_check_weak(const unsigned char key[MBEDTLS_DES_KEY_SIZE]) in mbedtls_des_key_check_weak() 398 if (memcmp(weak_key_table[i], key, MBEDTLS_DES_KEY_SIZE) == 0) { in mbedtls_des_key_check_weak() 407 void mbedtls_des_setkey(uint32_t SK[32], const unsigned char key[MBEDTLS_DES_KEY_SIZE]) in mbedtls_des_setkey() 412 X = MBEDTLS_GET_UINT32_BE(key, 0); in mbedtls_des_setkey() 413 Y = MBEDTLS_GET_UINT32_BE(key, 4); in mbedtls_des_setkey() 476 int mbedtls_des_setkey_enc(mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE]) in mbedtls_des_setkey_enc() [all …]
|
D | pkwrite.c | 173 const mbedtls_pk_context *key) in mbedtls_pk_write_pubkey() argument 179 if (mbedtls_pk_get_type(key) == MBEDTLS_PK_RSA) { in mbedtls_pk_write_pubkey() 180 MBEDTLS_ASN1_CHK_ADD(len, pk_write_rsa_pubkey(p, start, mbedtls_pk_rsa(*key))); in mbedtls_pk_write_pubkey() 184 if (mbedtls_pk_get_type(key) == MBEDTLS_PK_ECKEY) { in mbedtls_pk_write_pubkey() 185 MBEDTLS_ASN1_CHK_ADD(len, pk_write_ec_pubkey(p, start, mbedtls_pk_ec(*key))); in mbedtls_pk_write_pubkey() 189 if (mbedtls_pk_get_type(key) == MBEDTLS_PK_OPAQUE) { in mbedtls_pk_write_pubkey() 191 mbedtls_svc_key_id_t *key_id = (mbedtls_svc_key_id_t *) key->pk_ctx; in mbedtls_pk_write_pubkey() 212 int mbedtls_pk_write_pubkey_der(const mbedtls_pk_context *key, unsigned char *buf, size_t size) in mbedtls_pk_write_pubkey_der() argument 226 MBEDTLS_ASN1_CHK_ADD(len, mbedtls_pk_write_pubkey(&c, buf, key)); in mbedtls_pk_write_pubkey_der() 243 pk_type = mbedtls_pk_get_type(key); in mbedtls_pk_write_pubkey_der() [all …]
|
/mbedtls-3.5.0/tests/src/ |
D | psa_exercise_key.c | 43 static int check_key_attributes_sanity(mbedtls_svc_key_id_t key) in check_key_attributes_sanity() argument 52 PSA_ASSERT(psa_get_key_attributes(key, &attributes)); in check_key_attributes_sanity() 113 static int exercise_mac_key(mbedtls_svc_key_id_t key, in exercise_mac_key() argument 128 PSA_ASSERT(psa_mac_sign_setup(&operation, key, alg)); in exercise_mac_key() 141 PSA_ASSERT(psa_mac_verify_setup(&operation, key, alg)); in exercise_mac_key() 155 static int exercise_cipher_key(mbedtls_svc_key_id_t key, in exercise_cipher_key() argument 170 PSA_ASSERT(psa_get_key_attributes(key, &attributes)); in exercise_cipher_key() 175 PSA_ASSERT(psa_cipher_encrypt_setup(&operation, key, alg)); in exercise_cipher_key() 198 PSA_ASSERT(psa_cipher_decrypt_setup(&operation, key, alg)); in exercise_cipher_key() 230 static int exercise_aead_key(mbedtls_svc_key_id_t key, in exercise_aead_key() argument [all …]
|
/mbedtls-3.5.0/include/psa/ |
D | crypto.h | 145 mbedtls_svc_key_id_t key); 388 psa_status_t psa_get_key_attributes(mbedtls_svc_key_id_t key, 432 psa_status_t psa_purge_key(mbedtls_svc_key_id_t key); 572 psa_status_t psa_destroy_key(mbedtls_svc_key_id_t key); 654 mbedtls_svc_key_id_t *key); 746 psa_status_t psa_export_key(mbedtls_svc_key_id_t key, 821 psa_status_t psa_export_public_key(mbedtls_svc_key_id_t key, 1216 psa_status_t psa_mac_compute(mbedtls_svc_key_id_t key, 1257 psa_status_t psa_mac_verify(mbedtls_svc_key_id_t key, 1364 mbedtls_svc_key_id_t key, [all …]
|
/mbedtls-3.5.0/tests/scripts/ |
D | analyze_outcomes.py | 57 for key in available: 58 hits = outcomes[key].hits() if key in outcomes else 0 62 results.warning('Test case not executed: {}', key) 76 for key in available: 78 hits = outcomes[key].hits() if key in outcomes else 0 82 full_test_suite = key.split(';')[0] # retrieve full test suite name 83 test_string = key.split(';')[1] # retrieve the text string of this test 93 for entry in outcomes[key].successes: 99 Results.log(key) 120 key = ';'.join([suite, case]) [all …]
|
/mbedtls-3.5.0/docs/proposed/ |
D | psa-driver-interface.md | 14 … of a **core** and zero or more **drivers**. The core handles key management, enforces key usage p… 22 …lable for a particular combination of parameters (cryptographic algorithm, key type and size, etc.… 23 …oked for the specific [key location](#lifetimes-and-locations) that the driver is registered for: … 33 …ap keys with a built-in keys but not store user keys; and cryptoprocessors that store key material. 80 …atory for opaque drivers): information about the [representation of keys](#key-format-for-opaque-d… 88 … certain class of cryptographic mechanisms. The capability specifies which key types and algorithm… 94 …key type specification](#key-type-specifications). If specified, the core will invoke this capabil… 95 … involving a key with one of the specified key sizes. If omitted, the core will invoke this capabi… 109 * If the mechanism involves a key: 110 …* either the key is transparent (its location is `PSA_KEY_LOCATION_LOCAL_STORAGE`) and the driver … [all …]
|
/mbedtls-3.5.0/programs/pkey/ |
D | key_app_writer.c | 107 static int write_public_key(mbedtls_pk_context *key, const char *output_file) in write_public_key() argument 119 if ((ret = mbedtls_pk_write_pubkey_pem(key, output_buf, 16000)) != 0) { in write_public_key() 127 if ((ret = mbedtls_pk_write_pubkey_der(key, output_buf, 16000)) < 0) { in write_public_key() 149 static int write_private_key(mbedtls_pk_context *key, const char *output_file) in write_private_key() argument 161 if ((ret = mbedtls_pk_write_key_pem(key, output_buf, 16000)) != 0) { in write_private_key() 169 if ((ret = mbedtls_pk_write_key_der(key, output_buf, 16000)) < 0) { in write_private_key() 205 mbedtls_pk_context key; in main() local 214 mbedtls_pk_init(&key); in main() 303 ret = mbedtls_pk_parse_keyfile(&key, opt.filename, NULL, in main() 319 if (mbedtls_pk_get_type(&key) == MBEDTLS_PK_RSA) { in main() [all …]
|
/mbedtls-3.5.0/include/mbedtls/ |
D | des.h | 137 void mbedtls_des_key_set_parity(unsigned char key[MBEDTLS_DES_KEY_SIZE]); 154 int mbedtls_des_key_check_key_parity(const unsigned char key[MBEDTLS_DES_KEY_SIZE]); 168 int mbedtls_des_key_check_weak(const unsigned char key[MBEDTLS_DES_KEY_SIZE]); 183 int mbedtls_des_setkey_enc(mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE]); 198 int mbedtls_des_setkey_dec(mbedtls_des_context *ctx, const unsigned char key[MBEDTLS_DES_KEY_SIZE]); 214 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2]); 230 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 2]); 246 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3]); 262 const unsigned char key[MBEDTLS_DES_KEY_SIZE * 3]); 379 const unsigned char key[MBEDTLS_DES_KEY_SIZE]);
|
/mbedtls-3.5.0/programs/psa/ |
D | crypto_examples.c | 96 static psa_status_t cipher_encrypt(psa_key_id_t key, in cipher_encrypt() argument 112 status = psa_cipher_encrypt_setup(&operation, key, alg); in cipher_encrypt() 127 static psa_status_t cipher_decrypt(psa_key_id_t key, in cipher_decrypt() argument 142 status = psa_cipher_decrypt_setup(&operation, key, alg); in cipher_decrypt() 169 psa_key_id_t key = 0; in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block() local 185 status = psa_generate_key(&attributes, &key); in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block() 188 status = cipher_encrypt(key, alg, iv, sizeof(iv), in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block() 193 status = cipher_decrypt(key, alg, iv, sizeof(iv), in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block() 202 psa_destroy_key(key); in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block() 219 psa_key_id_t key = 0; in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi() local [all …]
|
/mbedtls-3.5.0/tests/data_files/ |
D | Makefile | 40 test_ca_key_file_rsa = test-ca.key 56 test-ca.key.der: $(test_ca_key_file_rsa) 58 all_final += test-ca.key.der 77 …$(OPENSSL) req -x509 -new -nodes -key $(test_ca_key_file_rsa) -passin "pass:$(test_ca_pwd_rsa)" -s… 81 …$(OPENSSL) req -x509 -new -nodes -key $(test_ca_key_file_rsa) -passin "pass:$(test_ca_pwd_rsa)" -s… 85 …$(OPENSSL) req -x509 -new -nodes -key $(test_ca_key_file_rsa) -passin "pass:$(test_ca_pwd_rsa)" -s… 88 test_ca_key_file_rsa_alt = test-ca-alt.key 91 …al 17 -config $(test_ca_config_file) -extensions dns_alt_names -days 3650 -key rsa_pkcs1_1024_clea… 97 …$(OPENSSL) req -new -subj '/CN=etcd' -config $(test_ca_config_file) -key rsa_pkcs1_1024_clear.pem … 99 …$(OPENSSL) req -new -subj '/CN=etcd' -config $(test_ca_config_file) -key rsa_pkcs1_1024_clear.pem … [all …]
|