blob: 36ed3f64ed2eac7405d62afefd7d252dd43ccb67 [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/**
12 * Hash operations on arbitrary sized data involve three operations,
13 * a setup, called once, an update called 1..* times and a finish
14 * to finalise theh hash operation.
15 */
16
17
Julian Hall0ed3d452021-07-15 14:31:07 +010018/****************************************
Julian Hallf5728962021-06-24 09:40:23 +010019 * hash_setup operation definition
20 */
21
22/* Mandatory fixed sized input parameters */
23struct __attribute__ ((__packed__)) ts_crypto_hash_setup_in
24{
25 uint32_t alg;
26};
27
28/* Mandatory fixed sized output parameters */
29struct __attribute__ ((__packed__)) ts_crypto_hash_setup_out
30{
31 uint32_t op_handle;
32};
33
Julian Hall0ed3d452021-07-15 14:31:07 +010034/****************************************
Julian Hallf5728962021-06-24 09:40:23 +010035 * hash_update operation definition
36 */
37
38/* Mandatory fixed sized input parameters */
39struct __attribute__ ((__packed__)) ts_crypto_hash_update_in
40{
41 uint32_t op_handle;
42};
43
44/* Variable length input parameter tags */
45enum
46{
47 TS_CRYPTO_HASH_UPDATE_IN_TAG_DATA = 1
48};
49
Julian Hall0ed3d452021-07-15 14:31:07 +010050/****************************************
Julian Hallf5728962021-06-24 09:40:23 +010051 * hash_finish operation definition
52 */
53
54/* Mandatory fixed sized input parameters */
55struct __attribute__ ((__packed__)) ts_crypto_hash_finish_in
56{
57 uint32_t op_handle;
58};
59
60/* Variable length output parameter tags */
61enum
62{
63 TS_CRYPTO_HASH_FINISH_OUT_TAG_HASH = 1
64};
65
Julian Hall0ed3d452021-07-15 14:31:07 +010066/****************************************
67 * hash_abort operation definition
68 */
69
70/* Mandatory fixed sized input parameters */
71struct __attribute__ ((__packed__)) ts_crypto_hash_abort_in
72{
73 uint32_t op_handle;
74};
75
76/****************************************
77 * hash_verify operation definition
78 */
79
80/* Mandatory fixed sized input parameters */
81struct __attribute__ ((__packed__)) ts_crypto_hash_verify_in
82{
83 uint32_t op_handle;
84};
85
86/* Variable length input parameter tags */
87enum
88{
89 TS_CRYPTO_HASH_VERIFY_IN_TAG_HASH = 1
90};
91
92/****************************************
93 * hash_clone operation definition
94 */
95
96/* Mandatory fixed sized input parameters */
97struct __attribute__ ((__packed__)) ts_crypto_hash_clone_in
98{
99 uint32_t source_op_handle;
100};
101
102/* Mandatory fixed sized output parameters */
103struct __attribute__ ((__packed__)) ts_crypto_hash_clone_out
104{
105 uint32_t target_op_handle;
106};
Julian Hallf5728962021-06-24 09:40:23 +0100107
108#endif /* TS_CRYPTO_HASH_H */