Jamie Fox | 5592db0 | 2017-12-18 16:48:29 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2017-2018, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __SST_TEST_SERVICE_SVC_H__ |
| 9 | #define __SST_TEST_SERVICE_SVC_H__ |
| 10 | |
| 11 | #include <stdint.h> |
| 12 | #include "tfm_sst_defs.h" |
| 13 | |
| 14 | #ifdef __cplusplus |
| 15 | extern "C" { |
| 16 | #endif |
| 17 | |
| 18 | /** |
| 19 | * \brief Sets-up the SST test service so that it is ready for test functions to |
| 20 | * be called. |
| 21 | * |
| 22 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 23 | */ |
| 24 | enum tfm_sst_err_t sst_test_service_svc_setup(void); |
| 25 | |
| 26 | /** |
| 27 | * \brief Performs a dummy encryption on the supplied buffer, using the key |
| 28 | * stored in the asset with the given UUID. |
| 29 | * |
| 30 | * \param[in] key_uuid UUID of asset containing key |
| 31 | * \param[in,out] buf Plaintext buffer |
| 32 | * \param[in] buf_size Size of buf |
| 33 | * |
| 34 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 35 | */ |
| 36 | enum tfm_sst_err_t sst_test_service_svc_dummy_encrypt(uint16_t key_uuid, |
| 37 | uint8_t *buf, |
| 38 | uint32_t buf_size); |
| 39 | |
| 40 | /** |
| 41 | * \brief Performs a dummy decryption on the supplied buffer, using the key |
| 42 | * stored in the asset with the given UUID. |
| 43 | * |
| 44 | * \param[in] key_uuid UUID of asset containing key |
| 45 | * \param[in,out] buf Ciphertext buffer |
| 46 | * \param[in] buf_size Size of buf |
| 47 | * |
| 48 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 49 | */ |
| 50 | enum tfm_sst_err_t sst_test_service_svc_dummy_decrypt(uint16_t key_uuid, |
| 51 | uint8_t *buf, |
| 52 | uint32_t buf_size); |
| 53 | |
| 54 | /** |
| 55 | * \brief Cleans the secure storage used by the SST test service. |
| 56 | * |
| 57 | * \return Returns error code as specified in \ref tfm_sst_err_t |
| 58 | */ |
| 59 | enum tfm_sst_err_t sst_test_service_svc_clean(void); |
| 60 | |
| 61 | #ifdef __cplusplus |
| 62 | } |
| 63 | #endif |
| 64 | |
| 65 | #endif /* __SST_TEST_SERVICE_SVC_H__ */ |