Lines Matching refs:operation
283 mbedtls_psa_cipher_operation_t *operation,
296 mbedtls_cipher_init(&operation->ctx.cipher);
298 operation->alg = alg;
306 ret = mbedtls_cipher_setup(&operation->ctx.cipher, cipher_info);
317 ret = mbedtls_cipher_setkey(&operation->ctx.cipher,
323 ret = mbedtls_cipher_setkey(&operation->ctx.cipher, key_buffer,
334 ret = mbedtls_cipher_set_padding_mode(&operation->ctx.cipher,
338 ret = mbedtls_cipher_set_padding_mode(&operation->ctx.cipher,
352 operation->block_length = (PSA_ALG_IS_STREAM_CIPHER(alg) ? 1 :
354 operation->iv_length = PSA_CIPHER_IV_LENGTH(key_type, alg);
361 mbedtls_psa_cipher_operation_t *operation,
366 return psa_cipher_setup(operation, attributes,
372 mbedtls_psa_cipher_operation_t *operation,
377 return psa_cipher_setup(operation, attributes,
383 mbedtls_psa_cipher_operation_t *operation,
386 if (iv_length != operation->iv_length) {
391 mbedtls_cipher_set_iv(&operation->ctx.cipher,
500 mbedtls_psa_cipher_operation_t *operation,
507 if (!PSA_ALG_IS_STREAM_CIPHER(operation->alg)) {
513 (operation->ctx.cipher.unprocessed_len + input_length)
514 / operation->block_length * operation->block_length;
524 if (operation->alg == PSA_ALG_ECB_NO_PADDING) {
528 status = psa_cipher_update_ecb(&operation->ctx.cipher,
541 mbedtls_cipher_update(&operation->ctx.cipher, input,
553 mbedtls_psa_cipher_operation_t *operation,
559 if (operation->ctx.cipher.unprocessed_len != 0) {
560 if (operation->alg == PSA_ALG_ECB_NO_PADDING ||
561 operation->alg == PSA_ALG_CBC_NO_PADDING) {
568 mbedtls_cipher_finish(&operation->ctx.cipher,
591 mbedtls_psa_cipher_operation_t *operation)
593 /* Sanity check (shouldn't happen: operation->alg should
595 if (!PSA_ALG_IS_CIPHER(operation->alg)) {
599 mbedtls_cipher_free(&operation->ctx.cipher);
618 mbedtls_psa_cipher_operation_t operation = MBEDTLS_PSA_CIPHER_OPERATION_INIT;
621 status = mbedtls_psa_cipher_encrypt_setup(&operation, attributes,
629 status = mbedtls_psa_cipher_set_iv(&operation, iv, iv_length);
635 status = mbedtls_psa_cipher_update(&operation, input, input_length,
643 &operation,
654 status = mbedtls_psa_cipher_abort(&operation);
656 mbedtls_psa_cipher_abort(&operation);
674 mbedtls_psa_cipher_operation_t operation = MBEDTLS_PSA_CIPHER_OPERATION_INIT;
677 status = mbedtls_psa_cipher_decrypt_setup(&operation, attributes,
684 if (operation.iv_length > 0) {
685 status = mbedtls_psa_cipher_set_iv(&operation,
686 input, operation.iv_length);
693 &operation,
694 mbedtls_buffer_offset_const(input, operation.iv_length),
695 input_length - operation.iv_length,
704 &operation,
715 status = mbedtls_psa_cipher_abort(&operation);
717 mbedtls_psa_cipher_abort(&operation);