blob: 22d22d61c2089f51bbf90cba466b4453433ea6e9 [file] [log] [blame]
Steven Cooremancd84cb42020-07-16 20:28:36 +02001/*
2 * Function signatures for functionality that can be provided by
3 * cryptographic accelerators.
Steven Cooreman56250fd2020-09-04 13:07:15 +02004 * Warning: This file will be auto-generated in the future.
Steven Cooremancd84cb42020-07-16 20:28:36 +02005 */
Steven Cooreman2c7b2f82020-09-02 13:43:46 +02006/* Copyright The Mbed TLS Contributors
Steven Cooremancd84cb42020-07-16 20:28:36 +02007 * SPDX-License-Identifier: Apache-2.0
8 *
9 * Licensed under the Apache License, Version 2.0 (the "License"); you may
10 * not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
12 *
13 * http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
Steven Cooremancd84cb42020-07-16 20:28:36 +020020 */
21
22#ifndef PSA_CRYPTO_DRIVER_WRAPPERS_H
23#define PSA_CRYPTO_DRIVER_WRAPPERS_H
24
25#include "psa/crypto.h"
26#include "psa/crypto_driver_common.h"
27
Steven Cooreman37941cb2020-07-28 18:49:51 +020028/*
29 * Signature functions
30 */
Ronald Cron9f17aa42020-12-08 17:07:25 +010031psa_status_t psa_driver_wrapper_sign_hash(
32 const psa_key_attributes_t *attributes,
33 const uint8_t *key_buffer, size_t key_buffer_size,
34 psa_algorithm_t alg, const uint8_t *hash, size_t hash_length,
35 uint8_t *signature, size_t signature_size, size_t *signature_length );
Steven Cooremancd84cb42020-07-16 20:28:36 +020036
Ronald Cron9f17aa42020-12-08 17:07:25 +010037psa_status_t psa_driver_wrapper_verify_hash(
38 const psa_key_attributes_t *attributes,
39 const uint8_t *key_buffer, size_t key_buffer_size,
40 psa_algorithm_t alg, const uint8_t *hash, size_t hash_length,
41 const uint8_t *signature, size_t signature_length );
Steven Cooreman55ae2172020-07-17 19:46:15 +020042
Steven Cooreman04524762020-10-13 17:43:44 +020043/*
44 * Key handling functions
45 */
46
Ronald Cron83282872020-11-22 14:02:39 +010047psa_status_t psa_driver_wrapper_import_key(
48 const psa_key_attributes_t *attributes,
49 const uint8_t *data, size_t data_length,
50 uint8_t *key_buffer, size_t key_buffer_size,
51 size_t *key_buffer_length, size_t *bits );
Steven Cooreman04524762020-10-13 17:43:44 +020052
Ronald Cron67227982020-11-26 15:16:05 +010053psa_status_t psa_driver_wrapper_export_key(
54 const psa_key_attributes_t *attributes,
55 const uint8_t *key_buffer, size_t key_buffer_size,
56 uint8_t *data, size_t data_size, size_t *data_length );
57
Ronald Cron84cc9942020-11-25 14:30:05 +010058psa_status_t psa_driver_wrapper_export_public_key(
59 const psa_key_attributes_t *attributes,
60 const uint8_t *key_buffer, size_t key_buffer_size,
61 uint8_t *data, size_t data_size, size_t *data_length );
62
Ronald Cron9df74be2020-12-05 19:15:23 +010063psa_status_t psa_driver_wrapper_get_key_buffer_size(
64 const psa_key_attributes_t *attributes,
65 size_t *key_buffer_size );
66
Ronald Cron84cc9942020-11-25 14:30:05 +010067psa_status_t psa_driver_wrapper_generate_key(
68 const psa_key_attributes_t *attributes,
Ronald Cron977c2472020-10-13 08:32:21 +020069 uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length );
Steven Cooremanb9b84422020-10-14 14:39:20 +020070
Steven Cooreman37941cb2020-07-28 18:49:51 +020071/*
72 * Cipher functions
73 */
74psa_status_t psa_driver_wrapper_cipher_encrypt(
75 psa_key_slot_t *slot,
76 psa_algorithm_t alg,
77 const uint8_t *input,
78 size_t input_length,
79 uint8_t *output,
80 size_t output_size,
81 size_t *output_length );
82
83psa_status_t psa_driver_wrapper_cipher_decrypt(
84 psa_key_slot_t *slot,
85 psa_algorithm_t alg,
86 const uint8_t *input,
87 size_t input_length,
88 uint8_t *output,
89 size_t output_size,
90 size_t *output_length );
91
92psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
Steven Cooremanfb81aa52020-09-09 12:01:43 +020093 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +020094 psa_key_slot_t *slot,
95 psa_algorithm_t alg );
96
97psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
Steven Cooremanfb81aa52020-09-09 12:01:43 +020098 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +020099 psa_key_slot_t *slot,
100 psa_algorithm_t alg );
101
102psa_status_t psa_driver_wrapper_cipher_generate_iv(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200103 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +0200104 uint8_t *iv,
105 size_t iv_size,
106 size_t *iv_length );
107
108psa_status_t psa_driver_wrapper_cipher_set_iv(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200109 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +0200110 const uint8_t *iv,
111 size_t iv_length );
112
113psa_status_t psa_driver_wrapper_cipher_update(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200114 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +0200115 const uint8_t *input,
116 size_t input_length,
117 uint8_t *output,
118 size_t output_size,
119 size_t *output_length );
120
121psa_status_t psa_driver_wrapper_cipher_finish(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200122 psa_operation_driver_context_t *operation,
Steven Cooreman37941cb2020-07-28 18:49:51 +0200123 uint8_t *output,
124 size_t output_size,
125 size_t *output_length );
126
127psa_status_t psa_driver_wrapper_cipher_abort(
Steven Cooremanfb81aa52020-09-09 12:01:43 +0200128 psa_operation_driver_context_t *operation );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200129
Steven Cooremancd84cb42020-07-16 20:28:36 +0200130#endif /* PSA_CRYPTO_DRIVER_WRAPPERS_H */
131
132/* End of automatically generated file. */