Lines Matching refs:operation
280 mbedtls_psa_cipher_operation_t *operation, in psa_cipher_setup() argument
293 mbedtls_cipher_init(&operation->ctx.cipher); in psa_cipher_setup()
295 operation->alg = alg; in psa_cipher_setup()
303 ret = mbedtls_cipher_setup(&operation->ctx.cipher, cipher_info); in psa_cipher_setup()
314 ret = mbedtls_cipher_setkey(&operation->ctx.cipher, in psa_cipher_setup()
320 ret = mbedtls_cipher_setkey(&operation->ctx.cipher, key_buffer, in psa_cipher_setup()
331 ret = mbedtls_cipher_set_padding_mode(&operation->ctx.cipher, in psa_cipher_setup()
335 ret = mbedtls_cipher_set_padding_mode(&operation->ctx.cipher, in psa_cipher_setup()
349 operation->block_length = (PSA_ALG_IS_STREAM_CIPHER(alg) ? 1 : in psa_cipher_setup()
351 operation->iv_length = PSA_CIPHER_IV_LENGTH(key_type, alg); in psa_cipher_setup()
358 mbedtls_psa_cipher_operation_t *operation, in mbedtls_psa_cipher_encrypt_setup() argument
363 return psa_cipher_setup(operation, attributes, in mbedtls_psa_cipher_encrypt_setup()
369 mbedtls_psa_cipher_operation_t *operation, in mbedtls_psa_cipher_decrypt_setup() argument
374 return psa_cipher_setup(operation, attributes, in mbedtls_psa_cipher_decrypt_setup()
380 mbedtls_psa_cipher_operation_t *operation, in mbedtls_psa_cipher_set_iv() argument
383 if (iv_length != operation->iv_length) { in mbedtls_psa_cipher_set_iv()
388 mbedtls_cipher_set_iv(&operation->ctx.cipher, in mbedtls_psa_cipher_set_iv()
497 mbedtls_psa_cipher_operation_t *operation, in mbedtls_psa_cipher_update() argument
504 if (!PSA_ALG_IS_STREAM_CIPHER(operation->alg)) { in mbedtls_psa_cipher_update()
510 (operation->ctx.cipher.unprocessed_len + input_length) in mbedtls_psa_cipher_update()
511 / operation->block_length * operation->block_length; in mbedtls_psa_cipher_update()
521 if (operation->alg == PSA_ALG_ECB_NO_PADDING) { in mbedtls_psa_cipher_update()
525 status = psa_cipher_update_ecb(&operation->ctx.cipher, in mbedtls_psa_cipher_update()
538 mbedtls_cipher_update(&operation->ctx.cipher, input, in mbedtls_psa_cipher_update()
550 mbedtls_psa_cipher_operation_t *operation, in mbedtls_psa_cipher_finish() argument
556 if (operation->ctx.cipher.unprocessed_len != 0) { in mbedtls_psa_cipher_finish()
557 if (operation->alg == PSA_ALG_ECB_NO_PADDING || in mbedtls_psa_cipher_finish()
558 operation->alg == PSA_ALG_CBC_NO_PADDING) { in mbedtls_psa_cipher_finish()
565 mbedtls_cipher_finish(&operation->ctx.cipher, in mbedtls_psa_cipher_finish()
588 mbedtls_psa_cipher_operation_t *operation) in mbedtls_psa_cipher_abort() argument
592 if (!PSA_ALG_IS_CIPHER(operation->alg)) { in mbedtls_psa_cipher_abort()
596 mbedtls_cipher_free(&operation->ctx.cipher); in mbedtls_psa_cipher_abort()
615 mbedtls_psa_cipher_operation_t operation = MBEDTLS_PSA_CIPHER_OPERATION_INIT; in mbedtls_psa_cipher_encrypt() local
618 status = mbedtls_psa_cipher_encrypt_setup(&operation, attributes, in mbedtls_psa_cipher_encrypt()
626 status = mbedtls_psa_cipher_set_iv(&operation, iv, iv_length); in mbedtls_psa_cipher_encrypt()
632 status = mbedtls_psa_cipher_update(&operation, input, input_length, in mbedtls_psa_cipher_encrypt()
640 &operation, in mbedtls_psa_cipher_encrypt()
651 status = mbedtls_psa_cipher_abort(&operation); in mbedtls_psa_cipher_encrypt()
653 mbedtls_psa_cipher_abort(&operation); in mbedtls_psa_cipher_encrypt()
671 mbedtls_psa_cipher_operation_t operation = MBEDTLS_PSA_CIPHER_OPERATION_INIT; in mbedtls_psa_cipher_decrypt() local
674 status = mbedtls_psa_cipher_decrypt_setup(&operation, attributes, in mbedtls_psa_cipher_decrypt()
681 if (operation.iv_length > 0) { in mbedtls_psa_cipher_decrypt()
682 status = mbedtls_psa_cipher_set_iv(&operation, in mbedtls_psa_cipher_decrypt()
683 input, operation.iv_length); in mbedtls_psa_cipher_decrypt()
690 &operation, in mbedtls_psa_cipher_decrypt()
691 mbedtls_buffer_offset_const(input, operation.iv_length), in mbedtls_psa_cipher_decrypt()
692 input_length - operation.iv_length, in mbedtls_psa_cipher_decrypt()
701 &operation, in mbedtls_psa_cipher_decrypt()
712 status = mbedtls_psa_cipher_abort(&operation); in mbedtls_psa_cipher_decrypt()
714 mbedtls_psa_cipher_abort(&operation); in mbedtls_psa_cipher_decrypt()