blob: 41abfe1880447bfcb1fa59088bf976bec95c4542 [file] [log] [blame]
Julian Hallf5728962021-06-24 09:40:23 +01001/*
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 Hallfe487b72021-07-19 10:29:59 +010012 * Protocol definitions for hash operations
13 * using the packed-c serialization.
Julian Hallf5728962021-06-24 09:40:23 +010014 */
15
Julian Hall0ed3d452021-07-15 14:31:07 +010016/****************************************
Julian Hallf5728962021-06-24 09:40:23 +010017 * hash_setup operation definition
18 */
19
20/* Mandatory fixed sized input parameters */
21struct __attribute__ ((__packed__)) ts_crypto_hash_setup_in
22{
23 uint32_t alg;
24};
25
26/* Mandatory fixed sized output parameters */
27struct __attribute__ ((__packed__)) ts_crypto_hash_setup_out
28{
29 uint32_t op_handle;
30};
31
Julian Hall0ed3d452021-07-15 14:31:07 +010032/****************************************
Julian Hallf5728962021-06-24 09:40:23 +010033 * hash_update operation definition
34 */
35
36/* Mandatory fixed sized input parameters */
37struct __attribute__ ((__packed__)) ts_crypto_hash_update_in
38{
39 uint32_t op_handle;
40};
41
42/* Variable length input parameter tags */
43enum
44{
45 TS_CRYPTO_HASH_UPDATE_IN_TAG_DATA = 1
46};
47
Julian Hall0ed3d452021-07-15 14:31:07 +010048/****************************************
Julian Hallf5728962021-06-24 09:40:23 +010049 * hash_finish operation definition
50 */
51
52/* Mandatory fixed sized input parameters */
53struct __attribute__ ((__packed__)) ts_crypto_hash_finish_in
54{
55 uint32_t op_handle;
56};
57
58/* Variable length output parameter tags */
59enum
60{
61 TS_CRYPTO_HASH_FINISH_OUT_TAG_HASH = 1
62};
63
Julian Hall0ed3d452021-07-15 14:31:07 +010064/****************************************
65 * hash_abort operation definition
66 */
67
68/* Mandatory fixed sized input parameters */
69struct __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 */
79struct __attribute__ ((__packed__)) ts_crypto_hash_verify_in
80{
81 uint32_t op_handle;
82};
83
84/* Variable length input parameter tags */
85enum
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 */
95struct __attribute__ ((__packed__)) ts_crypto_hash_clone_in
96{
97 uint32_t source_op_handle;
98};
99
100/* Mandatory fixed sized output parameters */
101struct __attribute__ ((__packed__)) ts_crypto_hash_clone_out
102{
103 uint32_t target_op_handle;
104};
Julian Hallf5728962021-06-24 09:40:23 +0100105
106#endif /* TS_CRYPTO_HASH_H */