Lines Matching refs:operation
67 import it. The import operation returns the identifier of the key for use
194 1. Allocate an operation (`psa_cipher_operation_t`) structure to pass to the cipher functions.
195 1. Initialize the operation structure to zero or to `PSA_CIPHER_OPERATION_INIT`.
199 1. Call `psa_cipher_finish()` to end the operation and output the encrypted message.
217 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT;
243 status = psa_cipher_encrypt_setup(&operation, key, alg);
245 printf("Failed to begin cipher operation\n");
248 status = psa_cipher_generate_iv(&operation, iv, sizeof(iv), &iv_len);
253 status = psa_cipher_update(&operation, plaintext, sizeof(plaintext),
256 printf("Failed to update cipher operation\n");
259 status = psa_cipher_finish(&operation, output + output_len,
262 printf("Failed to finish cipher operation\n");
267 /* Clean up cipher operation context */
268 psa_cipher_abort(&operation);
278 1. Allocate an operation (`psa_cipher_operation_t`) structure to pass to the cipher functions.
279 1. Initialize the operation structure to zero or to `PSA_CIPHER_OPERATION_INIT`.
283 1. Call `psa_cipher_finish()` to end the operation and output the decrypted message.
296 psa_cipher_operation_t operation = PSA_CIPHER_OPERATION_INIT;
327 status = psa_cipher_decrypt_setup(&operation, key, alg);
329 printf("Failed to begin cipher operation\n");
332 status = psa_cipher_set_iv(&operation, iv, sizeof(iv));
337 status = psa_cipher_update(&operation, ciphertext, sizeof(ciphertext),
340 printf("Failed to update cipher operation\n");
343 status = psa_cipher_finish(&operation, output + output_len,
346 printf("Failed to finish cipher operation\n");
351 /* Clean up cipher operation context */
352 psa_cipher_abort(&operation);
361 #### Handling cipher operation contexts
363 …ed the operation structure with a successful call to `psa_cipher_encrypt_setup()` or `psa_cipher_d…
365 …sa_cipher_abort()` frees any resources associated with the operation, except for the operation str…
371 …operation structure is invalidated; in other words, you cannot reuse the operation structure for t…
373 You must call `psa_cipher_abort()` at some point for any operation that is initialized successfully…
375 Making multiple sequential calls to `psa_cipher_abort()` on an operation that is terminated (either…
386 1. Allocate an operation structure (`psa_hash_operation_t`) to pass to the hash functions.
387 1. Initialize the operation structure to zero or to `PSA_HASH_OPERATION_INIT`.
396 psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT;
412 status = psa_hash_setup(&operation, alg);
414 printf("Failed to begin hash operation\n");
417 status = psa_hash_update(&operation, input, sizeof(input));
419 printf("Failed to update hash operation\n");
422 status = psa_hash_finish(&operation, actual_hash, sizeof(actual_hash),
425 printf("Failed to finish hash operation\n");
431 /* Clean up hash operation context */
432 psa_hash_abort(&operation);
441 psa_hash_operation_t operation = PSA_HASH_OPERATION_INIT;
461 status = psa_hash_setup(&operation, alg);
463 printf("Failed to begin hash operation\n");
466 status = psa_hash_update(&operation, input, sizeof(input));
468 printf("Failed to update hash operation\n");
471 status = psa_hash_verify(&operation, expected_hash, expected_hash_len);
479 /* Clean up hash operation context */
480 psa_hash_abort(&operation);
487 #### Handling hash operation contexts
489 …operation at any time by calling `psa_hash_abort()`. The call to `psa_hash_abort()` frees any reso…
496 …operation structure is invalidated; in other words, you cannot reuse the operation structure for t…
498 You must call `psa_hash_abort()` at some point for any operation that is initialized successfully (…
500 Making multiple sequential calls to `psa_hash_abort()` on an operation that has already been termin…
591 psa_key_derivation_operation_t operation =
621 status = psa_key_derivation_setup(&operation, alg);
626 status = psa_key_derivation_set_capacity(&operation, capacity);
631 status = psa_key_derivation_input_bytes(&operation,
638 status = psa_key_derivation_input_key(&operation,
645 status = psa_key_derivation_input_bytes(&operation,
656 status = psa_key_derivation_output_key(&attributes, &operation,
666 /* Clean up key derivation operation */
667 psa_key_derivation_abort(&operation);