Gabor Toth | c64890c | 2024-12-03 14:10:32 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2024, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef MOCK_CRYPTO_H |
| 9 | #define MOCK_CRYPTO_H |
| 10 | |
| 11 | #include <psa/crypto.h> |
| 12 | #ifdef __cplusplus |
| 13 | extern "C" { |
| 14 | #endif |
| 15 | |
| 16 | void expect_psa_crypto_init(psa_status_t result); |
| 17 | void expect_psa_reset_key_attributes(psa_key_attributes_t *attributes); |
| 18 | void expect_psa_destroy_key(psa_key_id_t key, psa_status_t result); |
| 19 | void expect_psa_import_key(const psa_key_attributes_t *attributes, const uint8_t *data, |
| 20 | size_t data_length, psa_key_id_t *key, psa_status_t result); |
| 21 | void expect_psa_cipher_encrypt_setup(psa_cipher_operation_t *operation, psa_key_id_t key, |
| 22 | psa_algorithm_t alg, psa_status_t result); |
| 23 | void expect_psa_cipher_decrypt_setup(psa_cipher_operation_t *operation, psa_key_id_t key, |
| 24 | psa_algorithm_t alg, psa_status_t result); |
| 25 | void expect_psa_cipher_set_iv(psa_cipher_operation_t *operation, const uint8_t *iv, |
| 26 | size_t iv_length, psa_status_t result); |
| 27 | void expect_psa_cipher_update(psa_cipher_operation_t *operation, const uint8_t *input, |
| 28 | size_t input_length, uint8_t *output, size_t output_size, |
| 29 | size_t *output_length, psa_status_t result); |
| 30 | void expect_psa_cipher_finish(psa_cipher_operation_t *operation, uint8_t *output, |
| 31 | size_t output_size, size_t *output_length, psa_status_t result); |
| 32 | void expect_psa_cipher_abort(psa_cipher_operation_t *operation, psa_status_t result); |
| 33 | void expect_psa_key_derivation_setup(psa_key_derivation_operation_t *operation, psa_algorithm_t alg, |
| 34 | psa_status_t result); |
| 35 | void expect_psa_key_derivation_input_bytes(psa_key_derivation_operation_t *operation, |
| 36 | psa_key_derivation_step_t step, const uint8_t *data, |
| 37 | size_t data_length, psa_status_t result); |
| 38 | void expect_psa_key_derivation_input_key(psa_key_derivation_operation_t *operation, |
| 39 | psa_key_derivation_step_t step, psa_key_id_t key, |
| 40 | psa_status_t result); |
| 41 | void expect_psa_key_derivation_output_key(const psa_key_attributes_t *attributes, |
| 42 | psa_key_derivation_operation_t *operation, |
| 43 | psa_key_id_t *key, psa_status_t result); |
| 44 | void expect_psa_key_derivation_abort(psa_key_derivation_operation_t *operation, |
| 45 | psa_status_t result); |
| 46 | |
| 47 | #ifdef __cplusplus |
| 48 | } |
| 49 | #endif |
| 50 | |
| 51 | #endif /* MOCK_CRYPTO_H */ |