blob: 48fb4703f9b7dfdf29d352edf456c26c4bf899fa [file] [log] [blame]
Julian Halle7bccbe2021-07-16 09:50:34 +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_CIPHER_H
7#define TS_CRYPTO_CIPHER_H
8
9#include <stdint.h>
10
11/**
Julian Hallfe487b72021-07-19 10:29:59 +010012 * Protocol definitions for symmetric cipher operations
13 * using the packed-c serialization.
Julian Halle7bccbe2021-07-16 09:50:34 +010014 */
15
Julian Halle7bccbe2021-07-16 09:50:34 +010016/****************************************
17 * cipher_setup operation definition (encrypt or decrypt)
18 */
19
20/* Mandatory fixed sized input parameters */
21struct __attribute__ ((__packed__)) ts_crypto_cipher_setup_in
22{
23 uint32_t key_id;
24 uint32_t alg;
25};
26
27/* Mandatory fixed sized output parameters */
28struct __attribute__ ((__packed__)) ts_crypto_cipher_setup_out
29{
30 uint32_t op_handle;
31};
32
33/****************************************
34 * cipher_generate_iv operation definition
35 */
36
37/* Mandatory fixed sized input parameters */
38struct __attribute__ ((__packed__)) ts_crypto_cipher_generate_iv_in
39{
40 uint32_t op_handle;
41};
42
43/* Variable length output parameter tags */
44enum
45{
46 TS_CRYPTO_CIPHER_GENERATE_IV_OUT_TAG_IV = 1
47};
48
49/****************************************
50 * cipher_set_iv operation definition
51 */
52
53/* Mandatory fixed sized input parameters */
54struct __attribute__ ((__packed__)) ts_crypto_cipher_set_iv_in
55{
56 uint32_t op_handle;
57};
58
59/* Variable length input parameter tags */
60enum
61{
62 TS_CRYPTO_CIPHER_SET_IV_IN_TAG_IV = 1
63};
64
65/****************************************
66 * cipher_update operation definition
67 */
68
69/* Mandatory fixed sized input parameters */
70struct __attribute__ ((__packed__)) ts_crypto_cipher_update_in
71{
72 uint32_t op_handle;
73};
74
75/* Variable length input parameter tags */
76enum
77{
78 TS_CRYPTO_CIPHER_UPDATE_IN_TAG_DATA = 1
79};
80
81/* Variable length output parameter tags */
82enum
83{
84 TS_CRYPTO_CIPHER_UPDATE_OUT_TAG_DATA = 1
85};
86
87/****************************************
88 * cipher_finish operation definition
89 */
90
91/* Mandatory fixed sized input parameters */
92struct __attribute__ ((__packed__)) ts_crypto_cipher_finish_in
93{
94 uint32_t op_handle;
95};
96
97/* Variable length output parameter tags */
98enum
99{
100 TS_CRYPTO_CIPHER_FINISH_OUT_TAG_DATA = 1
101};
102
103/****************************************
104 * cipher_abort operation definition
105 */
106
107/* Mandatory fixed sized input parameters */
108struct __attribute__ ((__packed__)) ts_crypto_cipher_abort_in
109{
110 uint32_t op_handle;
111};
112
113#endif /* TS_CRYPTO_CIPHER_H */