Julian Hall | a6d3cbc | 2021-07-20 10:13:21 +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_MAC_H |
| 7 | #define TS_CRYPTO_MAC_H |
| 8 | |
| 9 | #include <stdint.h> |
| 10 | |
| 11 | /** |
| 12 | * Protocol definitions for symmetric MAC operations |
| 13 | * using the packed-c serialization. |
| 14 | */ |
| 15 | |
| 16 | /**************************************** |
| 17 | * mac_setup operation definition (sign or verify) |
| 18 | */ |
| 19 | |
| 20 | /* Mandatory fixed sized input parameters */ |
| 21 | struct __attribute__ ((__packed__)) ts_crypto_mac_setup_in |
| 22 | { |
| 23 | uint32_t key_id; |
| 24 | uint32_t alg; |
| 25 | }; |
| 26 | |
| 27 | /* Mandatory fixed sized output parameters */ |
| 28 | struct __attribute__ ((__packed__)) ts_crypto_mac_setup_out |
| 29 | { |
| 30 | uint32_t op_handle; |
| 31 | }; |
| 32 | |
| 33 | /**************************************** |
| 34 | * mac_update operation definition |
| 35 | */ |
| 36 | |
| 37 | /* Mandatory fixed sized input parameters */ |
| 38 | struct __attribute__ ((__packed__)) ts_crypto_mac_update_in |
| 39 | { |
| 40 | uint32_t op_handle; |
| 41 | }; |
| 42 | |
| 43 | /* Variable length input parameter tags */ |
| 44 | enum |
| 45 | { |
| 46 | TS_CRYPTO_MAC_UPDATE_IN_TAG_DATA = 1 |
| 47 | }; |
| 48 | |
| 49 | /**************************************** |
| 50 | * mac_sign_finish operation definition |
| 51 | */ |
| 52 | |
| 53 | /* Mandatory fixed sized input parameters */ |
| 54 | struct __attribute__ ((__packed__)) ts_crypto_mac_sign_finish_in |
| 55 | { |
| 56 | uint32_t op_handle; |
| 57 | }; |
| 58 | |
| 59 | /* Variable length output parameter tags */ |
| 60 | enum |
| 61 | { |
| 62 | TS_CRYPTO_MAC_SIGN_FINISH_OUT_TAG_MAC = 1 |
| 63 | }; |
| 64 | |
| 65 | /**************************************** |
| 66 | * mac_verify_finish operation definition |
| 67 | */ |
| 68 | |
| 69 | /* Mandatory fixed sized input parameters */ |
| 70 | struct __attribute__ ((__packed__)) ts_crypto_mac_verify_finish_in |
| 71 | { |
| 72 | uint32_t op_handle; |
| 73 | }; |
| 74 | |
| 75 | /* Variable length input parameter tags */ |
| 76 | enum |
| 77 | { |
| 78 | TS_CRYPTO_MAC_VERIFY_FINISH_IN_TAG_MAC = 1 |
| 79 | }; |
| 80 | |
| 81 | /**************************************** |
| 82 | * mac_abort operation definition |
| 83 | */ |
| 84 | |
| 85 | /* Mandatory fixed sized input parameters */ |
| 86 | struct __attribute__ ((__packed__)) ts_crypto_mac_abort_in |
| 87 | { |
| 88 | uint32_t op_handle; |
| 89 | }; |
| 90 | |
| 91 | #endif /* TS_CRYPTO_MAC_H */ |