/mbedtls-3.5.0/library/ |
D | psa_crypto_pake.c | 168 static psa_status_t psa_pake_ecjpake_setup(mbedtls_psa_pake_operation_t *operation) in psa_pake_ecjpake_setup() argument 171 mbedtls_ecjpake_role role = (operation->role == PSA_PAKE_ROLE_CLIENT) ? in psa_pake_ecjpake_setup() 174 mbedtls_ecjpake_init(&operation->ctx.jpake); in psa_pake_ecjpake_setup() 176 ret = mbedtls_ecjpake_setup(&operation->ctx.jpake, in psa_pake_ecjpake_setup() 180 operation->password, in psa_pake_ecjpake_setup() 181 operation->password_len); in psa_pake_ecjpake_setup() 183 mbedtls_platform_zeroize(operation->password, operation->password_len); in psa_pake_ecjpake_setup() 193 psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation, in mbedtls_psa_pake_setup() argument 217 operation->password = mbedtls_calloc(1, password_len); in mbedtls_psa_pake_setup() 218 if (operation->password == NULL) { in mbedtls_psa_pake_setup() [all …]
|
D | psa_crypto_aead.c | 39 mbedtls_psa_aead_operation_t *operation, in psa_aead_setup() argument 64 operation->alg = PSA_ALG_CCM; in psa_aead_setup() 72 mbedtls_ccm_init(&operation->ctx.ccm); in psa_aead_setup() 74 mbedtls_ccm_setkey(&operation->ctx.ccm, cipher_id, in psa_aead_setup() 84 operation->alg = PSA_ALG_GCM; in psa_aead_setup() 92 mbedtls_gcm_init(&operation->ctx.gcm); in psa_aead_setup() 94 mbedtls_gcm_setkey(&operation->ctx.gcm, cipher_id, in psa_aead_setup() 104 operation->alg = PSA_ALG_CHACHA20_POLY1305; in psa_aead_setup() 110 mbedtls_chachapoly_init(&operation->ctx.chachapoly); in psa_aead_setup() 112 mbedtls_chachapoly_setkey(&operation->ctx.chachapoly, in psa_aead_setup() [all …]
|
D | psa_crypto_hash.c | 34 mbedtls_psa_hash_operation_t *operation) in mbedtls_psa_hash_abort() argument 36 switch (operation->alg) { in mbedtls_psa_hash_abort() 44 mbedtls_md5_free(&operation->ctx.md5); in mbedtls_psa_hash_abort() 49 mbedtls_ripemd160_free(&operation->ctx.ripemd160); in mbedtls_psa_hash_abort() 54 mbedtls_sha1_free(&operation->ctx.sha1); in mbedtls_psa_hash_abort() 59 mbedtls_sha256_free(&operation->ctx.sha256); in mbedtls_psa_hash_abort() 64 mbedtls_sha256_free(&operation->ctx.sha256); in mbedtls_psa_hash_abort() 69 mbedtls_sha512_free(&operation->ctx.sha512); in mbedtls_psa_hash_abort() 74 mbedtls_sha512_free(&operation->ctx.sha512); in mbedtls_psa_hash_abort() 80 operation->alg = 0; in mbedtls_psa_hash_abort() [all …]
|
D | psa_crypto_mac.c | 168 static psa_status_t cmac_setup(mbedtls_psa_mac_operation_t *operation, in cmac_setup() argument 195 ret = mbedtls_cipher_setup(&operation->ctx.cmac, cipher_info); in cmac_setup() 200 ret = mbedtls_cipher_cmac_starts(&operation->ctx.cmac, in cmac_setup() 214 mbedtls_psa_mac_operation_t *operation, in mac_init() argument 219 operation->alg = alg; in mac_init() 222 if (PSA_ALG_FULL_LENGTH_MAC(operation->alg) == PSA_ALG_CMAC) { in mac_init() 223 mbedtls_cipher_init(&operation->ctx.cmac); in mac_init() 228 if (PSA_ALG_IS_HMAC(operation->alg)) { in mac_init() 230 operation->ctx.hmac.alg = 0; in mac_init() 235 (void) operation; in mac_init() [all …]
|
D | psa_crypto.c | 2184 psa_status_t psa_hash_abort(psa_hash_operation_t *operation) argument 2187 if (operation->id == 0) { 2191 psa_status_t status = psa_driver_wrapper_hash_abort(operation); 2192 operation->id = 0; 2197 psa_status_t psa_hash_setup(psa_hash_operation_t *operation, argument 2203 if (operation->id != 0) { 2215 memset(&operation->ctx, 0, sizeof(operation->ctx)); 2217 status = psa_driver_wrapper_hash_setup(operation, alg); 2221 psa_hash_abort(operation); 2227 psa_status_t psa_hash_update(psa_hash_operation_t *operation, argument [all …]
|
D | psa_crypto_driver_wrappers.c | 539 psa_sign_hash_interruptible_operation_t *operation ) in psa_driver_wrapper_sign_hash_get_num_ops() argument 541 switch( operation->id ) in psa_driver_wrapper_sign_hash_get_num_ops() 548 return(mbedtls_psa_sign_hash_get_num_ops(&operation->ctx.mbedtls_ctx)); in psa_driver_wrapper_sign_hash_get_num_ops() 562 psa_verify_hash_interruptible_operation_t *operation ) in psa_driver_wrapper_verify_hash_get_num_ops() argument 564 switch( operation->id ) in psa_driver_wrapper_verify_hash_get_num_ops() 571 return (mbedtls_psa_verify_hash_get_num_ops(&operation->ctx.mbedtls_ctx)); in psa_driver_wrapper_verify_hash_get_num_ops() 586 psa_sign_hash_interruptible_operation_t *operation, in psa_driver_wrapper_sign_hash_start() argument 613 operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID; in psa_driver_wrapper_sign_hash_start() 614 return( mbedtls_psa_sign_hash_start( &operation->ctx.mbedtls_ctx, in psa_driver_wrapper_sign_hash_start() 628 ( void ) operation; in psa_driver_wrapper_sign_hash_start() [all …]
|
D | psa_crypto_cipher.c | 165 mbedtls_psa_cipher_operation_t *operation, in psa_cipher_setup() argument 178 mbedtls_cipher_init(&operation->ctx.cipher); in psa_cipher_setup() 180 operation->alg = alg; in psa_cipher_setup() 188 ret = mbedtls_cipher_setup(&operation->ctx.cipher, cipher_info); in psa_cipher_setup() 199 ret = mbedtls_cipher_setkey(&operation->ctx.cipher, in psa_cipher_setup() 205 ret = mbedtls_cipher_setkey(&operation->ctx.cipher, key_buffer, in psa_cipher_setup() 216 ret = mbedtls_cipher_set_padding_mode(&operation->ctx.cipher, in psa_cipher_setup() 220 ret = mbedtls_cipher_set_padding_mode(&operation->ctx.cipher, in psa_cipher_setup() 234 operation->block_length = (PSA_ALG_IS_STREAM_CIPHER(alg) ? 1 : in psa_cipher_setup() 236 operation->iv_length = PSA_CIPHER_IV_LENGTH(key_type, alg); in psa_cipher_setup() [all …]
|
D | psa_crypto_driver_wrappers.h | 74 psa_sign_hash_interruptible_operation_t *operation); 77 psa_verify_hash_interruptible_operation_t *operation); 80 psa_sign_hash_interruptible_operation_t *operation, 86 psa_sign_hash_interruptible_operation_t *operation, 91 psa_sign_hash_interruptible_operation_t *operation); 94 psa_verify_hash_interruptible_operation_t *operation, 101 psa_verify_hash_interruptible_operation_t *operation); 104 psa_verify_hash_interruptible_operation_t *operation); 178 psa_cipher_operation_t *operation, 184 psa_cipher_operation_t *operation, [all …]
|
D | psa_crypto_aead.h | 188 mbedtls_psa_aead_operation_t *operation, 231 mbedtls_psa_aead_operation_t *operation, 266 mbedtls_psa_aead_operation_t *operation, 307 mbedtls_psa_aead_operation_t *operation, 344 mbedtls_psa_aead_operation_t *operation, 404 mbedtls_psa_aead_operation_t *operation, 476 mbedtls_psa_aead_operation_t *operation, 509 mbedtls_psa_aead_operation_t *operation);
|
/mbedtls-3.5.0/include/psa/ |
D | crypto.h | 994 psa_status_t psa_hash_setup(psa_hash_operation_t *operation, 1020 psa_status_t psa_hash_update(psa_hash_operation_t *operation, 1066 psa_status_t psa_hash_finish(psa_hash_operation_t *operation, 1107 psa_status_t psa_hash_verify(psa_hash_operation_t *operation, 1136 psa_status_t psa_hash_abort(psa_hash_operation_t *operation); 1363 psa_status_t psa_mac_sign_setup(psa_mac_operation_t *operation, 1425 psa_status_t psa_mac_verify_setup(psa_mac_operation_t *operation, 1455 psa_status_t psa_mac_update(psa_mac_operation_t *operation, 1504 psa_status_t psa_mac_sign_finish(psa_mac_operation_t *operation, 1547 psa_status_t psa_mac_verify_finish(psa_mac_operation_t *operation, [all …]
|
/mbedtls-3.5.0/tests/src/drivers/ |
D | test_driver_mac.c | 83 mbedtls_transparent_test_driver_mac_operation_t *operation, in mbedtls_test_transparent_mac_sign_setup() argument 99 operation, in mbedtls_test_transparent_mac_sign_setup() 105 operation, attributes, key_buffer, key_buffer_size, alg); in mbedtls_test_transparent_mac_sign_setup() 107 (void) operation; in mbedtls_test_transparent_mac_sign_setup() 120 mbedtls_transparent_test_driver_mac_operation_t *operation, in mbedtls_test_transparent_mac_verify_setup() argument 136 operation, in mbedtls_test_transparent_mac_verify_setup() 142 operation, attributes, key_buffer, key_buffer_size, alg); in mbedtls_test_transparent_mac_verify_setup() 144 (void) operation; in mbedtls_test_transparent_mac_verify_setup() 157 mbedtls_transparent_test_driver_mac_operation_t *operation, in mbedtls_test_transparent_mac_update() argument 171 operation, input, input_length); in mbedtls_test_transparent_mac_update() [all …]
|
D | test_driver_cipher.c | 139 mbedtls_transparent_test_driver_cipher_operation_t *operation, in mbedtls_test_transparent_cipher_encrypt_setup() argument 150 memset(operation, 0, sizeof(*operation)); in mbedtls_test_transparent_cipher_encrypt_setup() 159 operation, in mbedtls_test_transparent_cipher_encrypt_setup() 164 operation, attributes, key, key_length, alg); in mbedtls_test_transparent_cipher_encrypt_setup() 171 mbedtls_transparent_test_driver_cipher_operation_t *operation, in mbedtls_test_transparent_cipher_decrypt_setup() argument 185 operation, in mbedtls_test_transparent_cipher_decrypt_setup() 190 operation, attributes, key, key_length, alg); in mbedtls_test_transparent_cipher_decrypt_setup() 197 mbedtls_transparent_test_driver_cipher_operation_t *operation) in mbedtls_test_transparent_cipher_abort() argument 203 libtestdriver1_mbedtls_psa_cipher_abort(operation); in mbedtls_test_transparent_cipher_abort() 205 mbedtls_psa_cipher_abort(operation); in mbedtls_test_transparent_cipher_abort() [all …]
|
D | test_driver_aead.c | 148 mbedtls_transparent_test_driver_aead_operation_t *operation, in mbedtls_test_transparent_aead_encrypt_setup() argument 162 libtestdriver1_mbedtls_psa_aead_encrypt_setup(operation, in mbedtls_test_transparent_aead_encrypt_setup() 169 mbedtls_psa_aead_encrypt_setup(operation, attributes, key_buffer, in mbedtls_test_transparent_aead_encrypt_setup() 172 (void) operation; in mbedtls_test_transparent_aead_encrypt_setup() 185 mbedtls_transparent_test_driver_aead_operation_t *operation, in mbedtls_test_transparent_aead_decrypt_setup() argument 199 libtestdriver1_mbedtls_psa_aead_decrypt_setup(operation, in mbedtls_test_transparent_aead_decrypt_setup() 205 mbedtls_psa_aead_decrypt_setup(operation, attributes, key_buffer, in mbedtls_test_transparent_aead_decrypt_setup() 208 (void) operation; in mbedtls_test_transparent_aead_decrypt_setup() 221 mbedtls_transparent_test_driver_aead_operation_t *operation, in mbedtls_test_transparent_aead_set_nonce() argument 234 libtestdriver1_mbedtls_psa_aead_set_nonce(operation, nonce, nonce_length); in mbedtls_test_transparent_aead_set_nonce() [all …]
|
D | test_driver_pake.c | 37 mbedtls_transparent_test_driver_pake_operation_t *operation, in mbedtls_test_transparent_pake_setup() argument 51 operation, (const libtestdriver1_psa_crypto_driver_pake_inputs_t *) inputs); in mbedtls_test_transparent_pake_setup() 55 operation, inputs); in mbedtls_test_transparent_pake_setup() 57 (void) operation; in mbedtls_test_transparent_pake_setup() 67 mbedtls_transparent_test_driver_pake_operation_t *operation, in mbedtls_test_transparent_pake_output() argument 97 operation, step, output, output_size, output_length); in mbedtls_test_transparent_pake_output() 101 operation, step, output, output_size, output_length); in mbedtls_test_transparent_pake_output() 103 (void) operation; in mbedtls_test_transparent_pake_output() 116 mbedtls_transparent_test_driver_pake_operation_t *operation, in mbedtls_test_transparent_pake_input() argument 132 operation, step, input, input_length); in mbedtls_test_transparent_pake_input() [all …]
|
D | hash.c | 71 mbedtls_transparent_test_driver_hash_operation_t *operation, in mbedtls_test_transparent_hash_setup() argument 83 libtestdriver1_mbedtls_psa_hash_setup(operation, alg); in mbedtls_test_transparent_hash_setup() 86 mbedtls_psa_hash_setup(operation, alg); in mbedtls_test_transparent_hash_setup() 88 (void) operation; in mbedtls_test_transparent_hash_setup() 126 mbedtls_transparent_test_driver_hash_operation_t *operation, in mbedtls_test_transparent_hash_update() argument 140 operation, input, input_length); in mbedtls_test_transparent_hash_update() 143 mbedtls_psa_hash_update(operation, input, input_length); in mbedtls_test_transparent_hash_update() 145 (void) operation; in mbedtls_test_transparent_hash_update() 156 mbedtls_transparent_test_driver_hash_operation_t *operation, in mbedtls_test_transparent_hash_finish() argument 171 operation, hash, hash_size, hash_length); in mbedtls_test_transparent_hash_finish() [all …]
|
/mbedtls-3.5.0/tests/suites/ |
D | test_suite_psa_crypto_hash.function | 18 psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT; 22 PSA_ASSERT(psa_hash_setup(&operation, alg)); 23 PSA_ASSERT(psa_hash_update(&operation, 25 PSA_ASSERT(psa_hash_finish(&operation, 32 psa_hash_abort(&operation); 41 psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT; 45 PSA_ASSERT(psa_hash_setup(&operation, alg)); 46 PSA_ASSERT(psa_hash_update(&operation, 49 PSA_ASSERT(psa_hash_verify(&operation, 54 psa_hash_abort(&operation); [all …]
|
D | test_suite_psa_crypto.function | 33 /* Assert that an operation is (not) active. 34 * This serves as a proxy for checking if the operation is aborted. */ 35 #define ASSERT_OPERATION_IS_ACTIVE(operation) TEST_ASSERT(operation.id != 0) 36 #define ASSERT_OPERATION_IS_INACTIVE(operation) TEST_ASSERT(operation.id == 0) 39 int ecjpake_operation_setup(psa_pake_operation_t *operation, 45 PSA_ASSERT(psa_pake_abort(operation)); 47 PSA_ASSERT(psa_pake_setup(operation, cipher_suite)); 49 PSA_ASSERT(psa_pake_set_role(operation, role)); 52 PSA_ASSERT(psa_pake_set_password_key(operation, key)); 178 psa_mac_operation_t *operation, [all …]
|
D | test_suite_psa_crypto_pake.function | 553 psa_pake_operation_t operation = psa_pake_operation_init(); 591 PSA_ASSERT(psa_pake_abort(&operation)); 594 TEST_EQUAL(psa_pake_set_user(&operation, user, user_len), 596 TEST_EQUAL(psa_pake_set_peer(&operation, peer, peer_len), 598 TEST_EQUAL(psa_pake_set_password_key(&operation, key), 600 TEST_EQUAL(psa_pake_set_role(&operation, PSA_PAKE_ROLE_SERVER), 602 TEST_EQUAL(psa_pake_output(&operation, PSA_PAKE_STEP_KEY_SHARE, 605 TEST_EQUAL(psa_pake_input(&operation, PSA_PAKE_STEP_KEY_SHARE, 608 TEST_EQUAL(psa_pake_get_implicit_key(&operation, &key_derivation), 613 SETUP_ALWAYS_CHECK_STEP(psa_pake_setup(&operation, &cipher_suite), [all …]
|
D | test_suite_psa_crypto_op_fail.function | 49 psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT; 57 psa_hash_setup(&operation, alg)); 66 psa_hash_abort(&operation); 78 psa_mac_operation_t operation = PSA_MAC_OPERATION_INIT; 97 psa_mac_sign_setup(&operation, key_id, alg)); 99 psa_mac_verify_setup(&operation, key_id, alg)); 110 psa_mac_abort(&operation); 124 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; 143 psa_cipher_encrypt_setup(&operation, key_id, alg)); 145 psa_cipher_decrypt_setup(&operation, key_id, alg)); [all …]
|
/mbedtls-3.5.0/scripts/data_files/driver_templates/ |
D | psa_crypto_driver_wrappers.c.jinja | 322 /* Fell through, meaning no accelerator supports this operation */ 438 psa_sign_hash_interruptible_operation_t *operation ) 440 switch( operation->id ) 447 return(mbedtls_psa_sign_hash_get_num_ops(&operation->ctx.mbedtls_ctx)); 461 psa_verify_hash_interruptible_operation_t *operation ) 463 switch( operation->id ) 470 return (mbedtls_psa_verify_hash_get_num_ops(&operation->ctx.mbedtls_ctx)); 485 psa_sign_hash_interruptible_operation_t *operation, 511 /* Fell through, meaning no accelerator supports this operation */ 512 operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID; [all …]
|
/mbedtls-3.5.0/tests/include/test/drivers/ |
D | mac.h | 60 mbedtls_transparent_test_driver_mac_operation_t *operation, 67 mbedtls_transparent_test_driver_mac_operation_t *operation, 74 mbedtls_transparent_test_driver_mac_operation_t *operation, 79 mbedtls_transparent_test_driver_mac_operation_t *operation, 85 mbedtls_transparent_test_driver_mac_operation_t *operation, 90 mbedtls_transparent_test_driver_mac_operation_t *operation); 104 mbedtls_opaque_test_driver_mac_operation_t *operation, 111 mbedtls_opaque_test_driver_mac_operation_t *operation, 118 mbedtls_opaque_test_driver_mac_operation_t *operation, 123 mbedtls_opaque_test_driver_mac_operation_t *operation, [all …]
|
D | cipher.h | 68 mbedtls_transparent_test_driver_cipher_operation_t *operation, 74 mbedtls_transparent_test_driver_cipher_operation_t *operation, 80 mbedtls_transparent_test_driver_cipher_operation_t *operation); 83 mbedtls_transparent_test_driver_cipher_operation_t *operation, 87 mbedtls_transparent_test_driver_cipher_operation_t *operation, 92 mbedtls_transparent_test_driver_cipher_operation_t *operation, 114 mbedtls_opaque_test_driver_cipher_operation_t *operation, 120 mbedtls_opaque_test_driver_cipher_operation_t *operation, 126 mbedtls_opaque_test_driver_cipher_operation_t *operation); 129 mbedtls_opaque_test_driver_cipher_operation_t *operation, [all …]
|
D | aead.h | 78 mbedtls_transparent_test_driver_aead_operation_t *operation, 84 mbedtls_transparent_test_driver_aead_operation_t *operation, 90 mbedtls_transparent_test_driver_aead_operation_t *operation, 95 mbedtls_transparent_test_driver_aead_operation_t *operation, 100 mbedtls_transparent_test_driver_aead_operation_t *operation, 105 mbedtls_transparent_test_driver_aead_operation_t *operation, 113 mbedtls_transparent_test_driver_aead_operation_t *operation, 122 mbedtls_transparent_test_driver_aead_operation_t *operation, 130 mbedtls_transparent_test_driver_aead_operation_t *operation);
|
/mbedtls-3.5.0/tests/src/ |
D | psa_exercise_key.c | 117 psa_mac_operation_t operation = PSA_MAC_OPERATION_INIT; in exercise_mac_key() local 128 PSA_ASSERT(psa_mac_sign_setup(&operation, key, alg)); in exercise_mac_key() 129 PSA_ASSERT(psa_mac_update(&operation, in exercise_mac_key() 131 PSA_ASSERT(psa_mac_sign_finish(&operation, in exercise_mac_key() 141 PSA_ASSERT(psa_mac_verify_setup(&operation, key, alg)); in exercise_mac_key() 142 PSA_ASSERT(psa_mac_update(&operation, in exercise_mac_key() 144 TEST_EQUAL(psa_mac_verify_finish(&operation, mac, mac_length), in exercise_mac_key() 151 psa_mac_abort(&operation); in exercise_mac_key() 159 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; in exercise_cipher_key() local 175 PSA_ASSERT(psa_cipher_encrypt_setup(&operation, key, alg)); in exercise_cipher_key() [all …]
|
/mbedtls-3.5.0/programs/psa/ |
D | crypto_examples.c | 61 static psa_status_t cipher_operation(psa_cipher_operation_t *operation, in cipher_operation() argument 78 status = psa_cipher_update(operation, input + bytes_written, in cipher_operation() 87 status = psa_cipher_finish(operation, output + *output_len, in cipher_operation() 108 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; in cipher_encrypt() local 111 memset(&operation, 0, sizeof(operation)); in cipher_encrypt() 112 status = psa_cipher_encrypt_setup(&operation, key, alg); in cipher_encrypt() 115 status = psa_cipher_generate_iv(&operation, iv, iv_size, &iv_len); in cipher_encrypt() 118 status = cipher_operation(&operation, input, input_size, part_size, in cipher_encrypt() 123 psa_cipher_abort(&operation); in cipher_encrypt() 139 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; in cipher_decrypt() local [all …]
|