Home
last modified time | relevance | path

Searched refs:operation (Results 1 – 25 of 81) sorted by relevance

1234

/mbedtls-latest/library/
Dpsa_crypto_pake.c128 static psa_status_t psa_pake_ecjpake_setup(mbedtls_psa_pake_operation_t *operation) in psa_pake_ecjpake_setup() argument
132 mbedtls_ecjpake_init(&operation->ctx.jpake); in psa_pake_ecjpake_setup()
134 ret = mbedtls_ecjpake_setup(&operation->ctx.jpake, in psa_pake_ecjpake_setup()
135 operation->role, in psa_pake_ecjpake_setup()
138 operation->password, in psa_pake_ecjpake_setup()
139 operation->password_len); in psa_pake_ecjpake_setup()
141 mbedtls_platform_zeroize(operation->password, operation->password_len); in psa_pake_ecjpake_setup()
155 psa_status_t mbedtls_psa_pake_setup(mbedtls_psa_pake_operation_t *operation, in mbedtls_psa_pake_setup() argument
184 operation->password = mbedtls_calloc(1, password_len); in mbedtls_psa_pake_setup()
185 if (operation->password == NULL) { in mbedtls_psa_pake_setup()
[all …]
Dpsa_crypto_aead.c27 mbedtls_psa_aead_operation_t *operation, in psa_aead_setup() argument
48 operation->alg = PSA_ALG_CCM; in psa_aead_setup()
56 mbedtls_ccm_init(&operation->ctx.ccm); in psa_aead_setup()
58 mbedtls_ccm_setkey(&operation->ctx.ccm, cipher_id, in psa_aead_setup()
68 operation->alg = PSA_ALG_GCM; in psa_aead_setup()
76 mbedtls_gcm_init(&operation->ctx.gcm); in psa_aead_setup()
78 mbedtls_gcm_setkey(&operation->ctx.gcm, cipher_id, in psa_aead_setup()
88 operation->alg = PSA_ALG_CHACHA20_POLY1305; in psa_aead_setup()
94 mbedtls_chachapoly_init(&operation->ctx.chachapoly); in psa_aead_setup()
96 mbedtls_chachapoly_setkey(&operation->ctx.chachapoly, in psa_aead_setup()
[all …]
Dpsa_crypto_hash.c22 mbedtls_psa_hash_operation_t *operation) in mbedtls_psa_hash_abort() argument
24 switch (operation->alg) { in mbedtls_psa_hash_abort()
32 mbedtls_md5_free(&operation->ctx.md5); in mbedtls_psa_hash_abort()
37 mbedtls_ripemd160_free(&operation->ctx.ripemd160); in mbedtls_psa_hash_abort()
42 mbedtls_sha1_free(&operation->ctx.sha1); in mbedtls_psa_hash_abort()
47 mbedtls_sha256_free(&operation->ctx.sha256); in mbedtls_psa_hash_abort()
52 mbedtls_sha256_free(&operation->ctx.sha256); in mbedtls_psa_hash_abort()
57 mbedtls_sha512_free(&operation->ctx.sha512); in mbedtls_psa_hash_abort()
62 mbedtls_sha512_free(&operation->ctx.sha512); in mbedtls_psa_hash_abort()
81 mbedtls_sha3_free(&operation->ctx.sha3); in mbedtls_psa_hash_abort()
[all …]
Dpsa_crypto_driver_wrappers.h565 psa_sign_hash_interruptible_operation_t *operation ) in psa_driver_wrapper_sign_hash_get_num_ops() argument
567 switch( operation->id ) in psa_driver_wrapper_sign_hash_get_num_ops()
574 return(mbedtls_psa_sign_hash_get_num_ops(&operation->ctx.mbedtls_ctx)); in psa_driver_wrapper_sign_hash_get_num_ops()
589 psa_verify_hash_interruptible_operation_t *operation ) in psa_driver_wrapper_verify_hash_get_num_ops() argument
591 switch( operation->id ) in psa_driver_wrapper_verify_hash_get_num_ops()
598 return (mbedtls_psa_verify_hash_get_num_ops(&operation->ctx.mbedtls_ctx)); in psa_driver_wrapper_verify_hash_get_num_ops()
614 psa_sign_hash_interruptible_operation_t *operation, in psa_driver_wrapper_sign_hash_start() argument
643 operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID; in psa_driver_wrapper_sign_hash_start()
644 status = mbedtls_psa_sign_hash_start( &operation->ctx.mbedtls_ctx, in psa_driver_wrapper_sign_hash_start()
662 psa_sign_hash_interruptible_operation_t *operation, in psa_driver_wrapper_sign_hash_complete() argument
[all …]
Dpsa_crypto.c2335 psa_status_t psa_hash_abort(psa_hash_operation_t *operation) argument
2338 if (operation->id == 0) {
2342 psa_status_t status = psa_driver_wrapper_hash_abort(operation);
2343 operation->id = 0;
2348 psa_status_t psa_hash_setup(psa_hash_operation_t *operation, argument
2354 if (operation->id != 0) {
2366 memset(&operation->ctx, 0, sizeof(operation->ctx));
2368 status = psa_driver_wrapper_hash_setup(operation, alg);
2372 psa_hash_abort(operation);
2378 psa_status_t psa_hash_update(psa_hash_operation_t *operation, argument
[all …]
Dpsa_crypto_mac.c157 static psa_status_t cmac_setup(mbedtls_psa_mac_operation_t *operation, in cmac_setup() argument
184 ret = mbedtls_cipher_setup(&operation->ctx.cmac, cipher_info); in cmac_setup()
189 ret = mbedtls_cipher_cmac_starts(&operation->ctx.cmac, in cmac_setup()
203 mbedtls_psa_mac_operation_t *operation, in mac_init() argument
208 operation->alg = alg; in mac_init()
211 if (PSA_ALG_FULL_LENGTH_MAC(operation->alg) == PSA_ALG_CMAC) { in mac_init()
212 mbedtls_cipher_init(&operation->ctx.cmac); in mac_init()
217 if (PSA_ALG_IS_HMAC(operation->alg)) { in mac_init()
219 operation->ctx.hmac.alg = 0; in mac_init()
224 (void) operation; in mac_init()
[all …]
Dpsa_crypto_cipher.c283 mbedtls_psa_cipher_operation_t *operation, in psa_cipher_setup() argument
296 mbedtls_cipher_init(&operation->ctx.cipher); in psa_cipher_setup()
298 operation->alg = alg; in psa_cipher_setup()
306 ret = mbedtls_cipher_setup(&operation->ctx.cipher, cipher_info); in psa_cipher_setup()
317 ret = mbedtls_cipher_setkey(&operation->ctx.cipher, in psa_cipher_setup()
323 ret = mbedtls_cipher_setkey(&operation->ctx.cipher, key_buffer, in psa_cipher_setup()
334 ret = mbedtls_cipher_set_padding_mode(&operation->ctx.cipher, in psa_cipher_setup()
338 ret = mbedtls_cipher_set_padding_mode(&operation->ctx.cipher, in psa_cipher_setup()
352 operation->block_length = (PSA_ALG_IS_STREAM_CIPHER(alg) ? 1 : in psa_cipher_setup()
354 operation->iv_length = PSA_CIPHER_IV_LENGTH(key_type, alg); in psa_cipher_setup()
[all …]
/mbedtls-latest/include/psa/
Dcrypto.h992 psa_status_t psa_hash_setup(psa_hash_operation_t *operation,
1018 psa_status_t psa_hash_update(psa_hash_operation_t *operation,
1064 psa_status_t psa_hash_finish(psa_hash_operation_t *operation,
1105 psa_status_t psa_hash_verify(psa_hash_operation_t *operation,
1134 psa_status_t psa_hash_abort(psa_hash_operation_t *operation);
1361 psa_status_t psa_mac_sign_setup(psa_mac_operation_t *operation,
1423 psa_status_t psa_mac_verify_setup(psa_mac_operation_t *operation,
1453 psa_status_t psa_mac_update(psa_mac_operation_t *operation,
1502 psa_status_t psa_mac_sign_finish(psa_mac_operation_t *operation,
1545 psa_status_t psa_mac_verify_finish(psa_mac_operation_t *operation,
[all …]
/mbedtls-latest/tests/src/drivers/
Dtest_driver_mac.c71 mbedtls_transparent_test_driver_mac_operation_t *operation, in mbedtls_test_transparent_mac_sign_setup() argument
87 operation, in mbedtls_test_transparent_mac_sign_setup()
93 operation, attributes, key_buffer, key_buffer_size, alg); in mbedtls_test_transparent_mac_sign_setup()
95 (void) operation; in mbedtls_test_transparent_mac_sign_setup()
108 mbedtls_transparent_test_driver_mac_operation_t *operation, in mbedtls_test_transparent_mac_verify_setup() argument
124 operation, in mbedtls_test_transparent_mac_verify_setup()
130 operation, attributes, key_buffer, key_buffer_size, alg); in mbedtls_test_transparent_mac_verify_setup()
132 (void) operation; in mbedtls_test_transparent_mac_verify_setup()
145 mbedtls_transparent_test_driver_mac_operation_t *operation, in mbedtls_test_transparent_mac_update() argument
159 operation, input, input_length); in mbedtls_test_transparent_mac_update()
[all …]
Dtest_driver_cipher.c131 mbedtls_transparent_test_driver_cipher_operation_t *operation, in mbedtls_test_transparent_cipher_encrypt_setup() argument
142 memset(operation, 0, sizeof(*operation)); in mbedtls_test_transparent_cipher_encrypt_setup()
151 operation, in mbedtls_test_transparent_cipher_encrypt_setup()
156 operation, attributes, key, key_length, alg); in mbedtls_test_transparent_cipher_encrypt_setup()
163 mbedtls_transparent_test_driver_cipher_operation_t *operation, in mbedtls_test_transparent_cipher_decrypt_setup() argument
177 operation, in mbedtls_test_transparent_cipher_decrypt_setup()
182 operation, attributes, key, key_length, alg); in mbedtls_test_transparent_cipher_decrypt_setup()
189 mbedtls_transparent_test_driver_cipher_operation_t *operation) in mbedtls_test_transparent_cipher_abort() argument
195 libtestdriver1_mbedtls_psa_cipher_abort(operation); in mbedtls_test_transparent_cipher_abort()
197 mbedtls_psa_cipher_abort(operation); in mbedtls_test_transparent_cipher_abort()
[all …]
Dtest_driver_aead.c138 mbedtls_transparent_test_driver_aead_operation_t *operation, in mbedtls_test_transparent_aead_encrypt_setup() argument
152 libtestdriver1_mbedtls_psa_aead_encrypt_setup(operation, in mbedtls_test_transparent_aead_encrypt_setup()
159 mbedtls_psa_aead_encrypt_setup(operation, attributes, key_buffer, in mbedtls_test_transparent_aead_encrypt_setup()
162 (void) operation; in mbedtls_test_transparent_aead_encrypt_setup()
175 mbedtls_transparent_test_driver_aead_operation_t *operation, in mbedtls_test_transparent_aead_decrypt_setup() argument
189 libtestdriver1_mbedtls_psa_aead_decrypt_setup(operation, in mbedtls_test_transparent_aead_decrypt_setup()
195 mbedtls_psa_aead_decrypt_setup(operation, attributes, key_buffer, in mbedtls_test_transparent_aead_decrypt_setup()
198 (void) operation; in mbedtls_test_transparent_aead_decrypt_setup()
211 mbedtls_transparent_test_driver_aead_operation_t *operation, in mbedtls_test_transparent_aead_set_nonce() argument
224 libtestdriver1_mbedtls_psa_aead_set_nonce(operation, nonce, nonce_length); in mbedtls_test_transparent_aead_set_nonce()
[all …]
Dtest_driver_pake.c25 mbedtls_transparent_test_driver_pake_operation_t *operation, in mbedtls_test_transparent_pake_setup() argument
39 operation, (const libtestdriver1_psa_crypto_driver_pake_inputs_t *) inputs); in mbedtls_test_transparent_pake_setup()
43 operation, inputs); in mbedtls_test_transparent_pake_setup()
45 (void) operation; in mbedtls_test_transparent_pake_setup()
55 mbedtls_transparent_test_driver_pake_operation_t *operation, in mbedtls_test_transparent_pake_output() argument
85 operation, (libtestdriver1_psa_crypto_driver_pake_step_t) step, in mbedtls_test_transparent_pake_output()
90 operation, step, output, output_size, output_length); in mbedtls_test_transparent_pake_output()
92 (void) operation; in mbedtls_test_transparent_pake_output()
105 mbedtls_transparent_test_driver_pake_operation_t *operation, in mbedtls_test_transparent_pake_input() argument
121 operation, (libtestdriver1_psa_crypto_driver_pake_step_t) step, in mbedtls_test_transparent_pake_input()
[all …]
Dhash.c59 mbedtls_transparent_test_driver_hash_operation_t *operation, in mbedtls_test_transparent_hash_setup() argument
71 libtestdriver1_mbedtls_psa_hash_setup(operation, alg); in mbedtls_test_transparent_hash_setup()
74 mbedtls_psa_hash_setup(operation, alg); in mbedtls_test_transparent_hash_setup()
76 (void) operation; in mbedtls_test_transparent_hash_setup()
114 mbedtls_transparent_test_driver_hash_operation_t *operation, in mbedtls_test_transparent_hash_update() argument
128 operation, input, input_length); in mbedtls_test_transparent_hash_update()
131 mbedtls_psa_hash_update(operation, input, input_length); in mbedtls_test_transparent_hash_update()
133 (void) operation; in mbedtls_test_transparent_hash_update()
144 mbedtls_transparent_test_driver_hash_operation_t *operation, in mbedtls_test_transparent_hash_finish() argument
159 operation, hash, hash_size, hash_length); in mbedtls_test_transparent_hash_finish()
[all …]
/mbedtls-latest/tests/suites/
Dtest_suite_psa_crypto.function37 /* Assert that an operation is (not) active.
38 * This serves as a proxy for checking if the operation is aborted. */
39 #define ASSERT_OPERATION_IS_ACTIVE(operation) TEST_ASSERT(operation.id != 0)
40 #define ASSERT_OPERATION_IS_INACTIVE(operation) TEST_ASSERT(operation.id == 0)
160 psa_mac_operation_t *operation,
171 *status = psa_mac_sign_setup(operation, key, alg);
173 PSA_ASSERT(psa_mac_abort(operation));
175 * test the resulting state of the operation object. */
177 TEST_EQUAL(psa_mac_sign_setup(operation, key, alg), *status);
192 psa_cipher_operation_t *operation,
[all …]
Dtest_suite_psa_crypto_pake.function596 psa_pake_operation_t operation = psa_pake_operation_init();
634 PSA_ASSERT(psa_pake_abort(&operation));
637 TEST_EQUAL(psa_pake_set_user(&operation, user, user_len),
639 TEST_EQUAL(psa_pake_set_peer(&operation, peer, peer_len),
641 TEST_EQUAL(psa_pake_set_password_key(&operation, key),
643 TEST_EQUAL(psa_pake_set_role(&operation, PSA_PAKE_ROLE_SERVER),
645 TEST_EQUAL(psa_pake_output(&operation, PSA_PAKE_STEP_KEY_SHARE,
648 TEST_EQUAL(psa_pake_input(&operation, PSA_PAKE_STEP_KEY_SHARE,
651 TEST_EQUAL(psa_pake_get_implicit_key(&operation, &key_derivation),
656 SETUP_ALWAYS_CHECK_STEP(psa_pake_setup(&operation, &cipher_suite),
[all …]
Dtest_suite_psa_crypto_hash.function19 psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT;
23 PSA_ASSERT(psa_hash_setup(&operation, alg));
24 PSA_ASSERT(psa_hash_update(&operation,
26 PSA_ASSERT(psa_hash_finish(&operation,
33 psa_hash_abort(&operation);
88 psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT;
92 PSA_ASSERT(psa_hash_setup(&operation, alg));
93 PSA_ASSERT(psa_hash_update(&operation,
96 PSA_ASSERT(psa_hash_verify(&operation,
101 psa_hash_abort(&operation);
[all …]
Dtest_suite_psa_crypto_op_fail.function49 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 …]
Dtest_suite_psa_crypto_driver_wrappers.function447 /* Perform the private key operation */
1060 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT;
1086 PSA_ASSERT(psa_cipher_encrypt_setup(&operation, key, alg));
1090 PSA_ASSERT(psa_cipher_set_iv(&operation, output1, iv_size));
1094 PSA_ASSERT(psa_cipher_update(&operation,
1102 PSA_ASSERT(psa_cipher_finish(&operation,
1112 PSA_ASSERT(psa_cipher_abort(&operation));
1119 psa_cipher_abort(&operation);
1155 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT;
1160 /* Test operation initialization */
[all …]
Dtest_suite_psa_crypto_low_hash.function101 /* Nominal case with an operation cloned after setup */
110 /* Nominal case with an operation cloned between updates */
119 /* Nominal case with an operation cloned before finish */
146 /* Nominal case again after an error in a cloned operation */
173 mbedtls_psa_hash_operation_t operation;
174 memset(&operation, 0, sizeof(operation));
186 TEST_EQUAL(mbedtls_psa_hash_setup(&operation, alg),
188 TEST_EQUAL(mbedtls_psa_hash_finish(&operation,
195 memset(&operation, 0, sizeof(operation));
196 TEST_EQUAL(mbedtls_psa_hash_setup(&operation, alg),
[all …]
/mbedtls-latest/scripts/data_files/driver_templates/
Dpsa_crypto_driver_wrappers.h.jinja329 /* Fell through, meaning no accelerator supports this operation */
464 psa_sign_hash_interruptible_operation_t *operation )
466 switch( operation->id )
473 return(mbedtls_psa_sign_hash_get_num_ops(&operation->ctx.mbedtls_ctx));
488 psa_verify_hash_interruptible_operation_t *operation )
490 switch( operation->id )
497 return (mbedtls_psa_verify_hash_get_num_ops(&operation->ctx.mbedtls_ctx));
513 psa_sign_hash_interruptible_operation_t *operation,
538 /* Fell through, meaning no accelerator supports this operation */
539 operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
[all …]
/mbedtls-latest/tests/src/
Dpsa_exercise_key.c125 psa_mac_operation_t operation = PSA_MAC_OPERATION_INIT; in exercise_mac_key() local
136 status = psa_mac_sign_setup(&operation, key, alg); in exercise_mac_key()
139 PSA_ASSERT(psa_mac_abort(&operation)); in exercise_mac_key()
143 PSA_ASSERT(psa_mac_update(&operation, in exercise_mac_key()
145 PSA_ASSERT(psa_mac_sign_finish(&operation, in exercise_mac_key()
155 status = psa_mac_verify_setup(&operation, key, alg); in exercise_mac_key()
158 PSA_ASSERT(psa_mac_abort(&operation)); in exercise_mac_key()
162 PSA_ASSERT(psa_mac_update(&operation, in exercise_mac_key()
164 TEST_EQUAL(psa_mac_verify_finish(&operation, mac, mac_length), in exercise_mac_key()
171 psa_mac_abort(&operation); in exercise_mac_key()
[all …]
/mbedtls-latest/tests/include/test/drivers/
Dmac.h48 mbedtls_transparent_test_driver_mac_operation_t *operation,
55 mbedtls_transparent_test_driver_mac_operation_t *operation,
62 mbedtls_transparent_test_driver_mac_operation_t *operation,
67 mbedtls_transparent_test_driver_mac_operation_t *operation,
73 mbedtls_transparent_test_driver_mac_operation_t *operation,
78 mbedtls_transparent_test_driver_mac_operation_t *operation);
92 mbedtls_opaque_test_driver_mac_operation_t *operation,
99 mbedtls_opaque_test_driver_mac_operation_t *operation,
106 mbedtls_opaque_test_driver_mac_operation_t *operation,
111 mbedtls_opaque_test_driver_mac_operation_t *operation,
[all …]
Dcipher.h62 mbedtls_transparent_test_driver_cipher_operation_t *operation,
68 mbedtls_transparent_test_driver_cipher_operation_t *operation,
74 mbedtls_transparent_test_driver_cipher_operation_t *operation);
77 mbedtls_transparent_test_driver_cipher_operation_t *operation,
81 mbedtls_transparent_test_driver_cipher_operation_t *operation,
86 mbedtls_transparent_test_driver_cipher_operation_t *operation,
108 mbedtls_opaque_test_driver_cipher_operation_t *operation,
114 mbedtls_opaque_test_driver_cipher_operation_t *operation,
120 mbedtls_opaque_test_driver_cipher_operation_t *operation);
123 mbedtls_opaque_test_driver_cipher_operation_t *operation,
[all …]
Daead.h66 mbedtls_transparent_test_driver_aead_operation_t *operation,
72 mbedtls_transparent_test_driver_aead_operation_t *operation,
78 mbedtls_transparent_test_driver_aead_operation_t *operation,
83 mbedtls_transparent_test_driver_aead_operation_t *operation,
88 mbedtls_transparent_test_driver_aead_operation_t *operation,
93 mbedtls_transparent_test_driver_aead_operation_t *operation,
101 mbedtls_transparent_test_driver_aead_operation_t *operation,
110 mbedtls_transparent_test_driver_aead_operation_t *operation,
118 mbedtls_transparent_test_driver_aead_operation_t *operation);
/mbedtls-latest/programs/psa/
Dcrypto_examples.c49 static psa_status_t cipher_operation(psa_cipher_operation_t *operation, in cipher_operation() argument
66 status = psa_cipher_update(operation, input + bytes_written, in cipher_operation()
75 status = psa_cipher_finish(operation, output + *output_len, in cipher_operation()
96 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; in cipher_encrypt() local
99 memset(&operation, 0, sizeof(operation)); in cipher_encrypt()
100 status = psa_cipher_encrypt_setup(&operation, key, alg); in cipher_encrypt()
103 status = psa_cipher_generate_iv(&operation, iv, iv_size, &iv_len); in cipher_encrypt()
106 status = cipher_operation(&operation, input, input_size, part_size, in cipher_encrypt()
111 psa_cipher_abort(&operation); in cipher_encrypt()
127 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT; in cipher_decrypt() local
[all …]

1234