Julian Hall | f572896 | 2021-06-24 09:40:23 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021, Arm Limited and Contributors. All rights reserved. |
| 3 | * SPDX-License-Identifier: BSD-3-Clause |
| 4 | */ |
| 5 | |
| 6 | #ifndef TS_CRYPTO_HASH_H |
| 7 | #define TS_CRYPTO_HASH_H |
| 8 | |
| 9 | #include <stdint.h> |
| 10 | |
| 11 | /** |
Julian Hall | fe487b7 | 2021-07-19 10:29:59 +0100 | [diff] [blame] | 12 | * Protocol definitions for hash operations |
| 13 | * using the packed-c serialization. |
Julian Hall | f572896 | 2021-06-24 09:40:23 +0100 | [diff] [blame] | 14 | */ |
| 15 | |
Julian Hall | 0ed3d45 | 2021-07-15 14:31:07 +0100 | [diff] [blame] | 16 | /**************************************** |
Julian Hall | f572896 | 2021-06-24 09:40:23 +0100 | [diff] [blame] | 17 | * hash_setup operation definition |
| 18 | */ |
| 19 | |
| 20 | /* Mandatory fixed sized input parameters */ |
| 21 | struct __attribute__ ((__packed__)) ts_crypto_hash_setup_in |
| 22 | { |
| 23 | uint32_t alg; |
| 24 | }; |
| 25 | |
| 26 | /* Mandatory fixed sized output parameters */ |
| 27 | struct __attribute__ ((__packed__)) ts_crypto_hash_setup_out |
| 28 | { |
| 29 | uint32_t op_handle; |
| 30 | }; |
| 31 | |
Julian Hall | 0ed3d45 | 2021-07-15 14:31:07 +0100 | [diff] [blame] | 32 | /**************************************** |
Julian Hall | f572896 | 2021-06-24 09:40:23 +0100 | [diff] [blame] | 33 | * hash_update operation definition |
| 34 | */ |
| 35 | |
| 36 | /* Mandatory fixed sized input parameters */ |
| 37 | struct __attribute__ ((__packed__)) ts_crypto_hash_update_in |
| 38 | { |
| 39 | uint32_t op_handle; |
| 40 | }; |
| 41 | |
| 42 | /* Variable length input parameter tags */ |
| 43 | enum |
| 44 | { |
| 45 | TS_CRYPTO_HASH_UPDATE_IN_TAG_DATA = 1 |
| 46 | }; |
| 47 | |
Julian Hall | 0ed3d45 | 2021-07-15 14:31:07 +0100 | [diff] [blame] | 48 | /**************************************** |
Julian Hall | f572896 | 2021-06-24 09:40:23 +0100 | [diff] [blame] | 49 | * hash_finish operation definition |
| 50 | */ |
| 51 | |
| 52 | /* Mandatory fixed sized input parameters */ |
| 53 | struct __attribute__ ((__packed__)) ts_crypto_hash_finish_in |
| 54 | { |
| 55 | uint32_t op_handle; |
| 56 | }; |
| 57 | |
| 58 | /* Variable length output parameter tags */ |
| 59 | enum |
| 60 | { |
| 61 | TS_CRYPTO_HASH_FINISH_OUT_TAG_HASH = 1 |
| 62 | }; |
| 63 | |
Julian Hall | 0ed3d45 | 2021-07-15 14:31:07 +0100 | [diff] [blame] | 64 | /**************************************** |
| 65 | * hash_abort operation definition |
| 66 | */ |
| 67 | |
| 68 | /* Mandatory fixed sized input parameters */ |
| 69 | struct __attribute__ ((__packed__)) ts_crypto_hash_abort_in |
| 70 | { |
| 71 | uint32_t op_handle; |
| 72 | }; |
| 73 | |
| 74 | /**************************************** |
| 75 | * hash_verify operation definition |
| 76 | */ |
| 77 | |
| 78 | /* Mandatory fixed sized input parameters */ |
| 79 | struct __attribute__ ((__packed__)) ts_crypto_hash_verify_in |
| 80 | { |
| 81 | uint32_t op_handle; |
| 82 | }; |
| 83 | |
| 84 | /* Variable length input parameter tags */ |
| 85 | enum |
| 86 | { |
| 87 | TS_CRYPTO_HASH_VERIFY_IN_TAG_HASH = 1 |
| 88 | }; |
| 89 | |
| 90 | /**************************************** |
| 91 | * hash_clone operation definition |
| 92 | */ |
| 93 | |
| 94 | /* Mandatory fixed sized input parameters */ |
| 95 | struct __attribute__ ((__packed__)) ts_crypto_hash_clone_in |
| 96 | { |
| 97 | uint32_t source_op_handle; |
| 98 | }; |
| 99 | |
| 100 | /* Mandatory fixed sized output parameters */ |
| 101 | struct __attribute__ ((__packed__)) ts_crypto_hash_clone_out |
| 102 | { |
| 103 | uint32_t target_op_handle; |
| 104 | }; |
Julian Hall | f572896 | 2021-06-24 09:40:23 +0100 | [diff] [blame] | 105 | |
| 106 | #endif /* TS_CRYPTO_HASH_H */ |