blob: e04fd898c53be728ddbf766157d4a1634fcffa22 [file] [log] [blame]
Steven Cooreman37941cb2020-07-28 18:49:51 +02001/*
2 * Test driver for cipher functions.
3 * Currently only supports multi-part operations using AES-CTR.
4 */
Steven Cooreman3ec40182020-09-02 16:27:46 +02005/* Copyright The Mbed TLS Contributors
Steven Cooreman37941cb2020-07-28 18:49:51 +02006 * SPDX-License-Identifier: Apache-2.0
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
9 * not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
Steven Cooreman37941cb2020-07-28 18:49:51 +020019 */
20
21#if !defined(MBEDTLS_CONFIG_FILE)
22#include "mbedtls/config.h"
23#else
24#include MBEDTLS_CONFIG_FILE
25#endif
26
27#if defined(MBEDTLS_PSA_CRYPTO_DRIVERS) && defined(PSA_CRYPTO_DRIVER_TEST)
28#include "psa/crypto.h"
Steven Cooremanacb5a102020-09-08 14:06:57 +020029#include "psa_crypto_core.h"
Steven Cooreman37941cb2020-07-28 18:49:51 +020030#include "mbedtls/cipher.h"
31
Steven Cooremanacb5a102020-09-08 14:06:57 +020032#include "test/drivers/cipher.h"
Steven Cooreman37941cb2020-07-28 18:49:51 +020033
34#include "test/random.h"
35
36#include <string.h>
37
Steven Cooreman5240e8b2020-09-09 11:51:45 +020038/* Test driver implements AES-CTR only. Its default behaviour (when its return
39 * status is not overridden through the hooks) is to take care of all AES-CTR
40 * operations, and return PSA_ERROR_NOT_SUPPORTED for all others.
Steven Cooremanacb5a102020-09-08 14:06:57 +020041 * Set test_driver_cipher_hooks.forced_status to PSA_ERROR_NOT_SUPPORTED to use
Steven Cooreman5240e8b2020-09-09 11:51:45 +020042 * fallback even for AES-CTR. */
Steven Cooremanacb5a102020-09-08 14:06:57 +020043test_driver_cipher_hooks_t test_driver_cipher_hooks = TEST_DRIVER_CIPHER_INIT;
Steven Cooreman37941cb2020-07-28 18:49:51 +020044
45psa_status_t test_transparent_cipher_encrypt(
46 const psa_key_attributes_t *attributes,
47 const uint8_t *key, size_t key_length,
48 psa_algorithm_t alg,
49 const uint8_t *input, size_t input_length,
50 uint8_t *output, size_t output_size, size_t *output_length)
51{
52 (void) attributes;
53 (void) key;
54 (void) key_length;
55 (void) alg;
56 (void) input;
57 (void) input_length;
Steven Cooremanacb5a102020-09-08 14:06:57 +020058 test_driver_cipher_hooks.hits++;
Steven Cooreman37941cb2020-07-28 18:49:51 +020059
Steven Cooremanacb5a102020-09-08 14:06:57 +020060 if( test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
61 return( test_driver_cipher_hooks.forced_status );
62 if( output_size < test_driver_cipher_hooks.forced_output_length )
63 return( PSA_ERROR_BUFFER_TOO_SMALL );
Steven Cooreman37941cb2020-07-28 18:49:51 +020064
Steven Cooremanacb5a102020-09-08 14:06:57 +020065 memcpy( output,
66 test_driver_cipher_hooks.forced_output,
67 test_driver_cipher_hooks.forced_output_length );
68 *output_length = test_driver_cipher_hooks.forced_output_length;
Steven Cooreman37941cb2020-07-28 18:49:51 +020069
Steven Cooremanacb5a102020-09-08 14:06:57 +020070 return( test_driver_cipher_hooks.forced_status );
Steven Cooreman37941cb2020-07-28 18:49:51 +020071}
72
73psa_status_t test_transparent_cipher_decrypt(
74 const psa_key_attributes_t *attributes,
75 const uint8_t *key, size_t key_length,
76 psa_algorithm_t alg,
77 const uint8_t *input, size_t input_length,
78 uint8_t *output, size_t output_size, size_t *output_length)
79{
80 (void) attributes;
81 (void) key;
82 (void) key_length;
83 (void) alg;
84 (void) input;
85 (void) input_length;
Steven Cooremanacb5a102020-09-08 14:06:57 +020086 test_driver_cipher_hooks.hits++;
Steven Cooreman37941cb2020-07-28 18:49:51 +020087
Steven Cooremanacb5a102020-09-08 14:06:57 +020088 if( test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
89 return( test_driver_cipher_hooks.forced_status );
90 if( output_size < test_driver_cipher_hooks.forced_output_length )
91 return( PSA_ERROR_BUFFER_TOO_SMALL );
Steven Cooreman37941cb2020-07-28 18:49:51 +020092
Steven Cooremanacb5a102020-09-08 14:06:57 +020093 memcpy( output,
94 test_driver_cipher_hooks.forced_output,
95 test_driver_cipher_hooks.forced_output_length );
96 *output_length = test_driver_cipher_hooks.forced_output_length;
Steven Cooreman37941cb2020-07-28 18:49:51 +020097
Steven Cooremanacb5a102020-09-08 14:06:57 +020098 return( test_driver_cipher_hooks.forced_status );
Steven Cooreman37941cb2020-07-28 18:49:51 +020099}
100
Steven Cooreman16afd3d2020-09-09 15:36:39 +0200101static psa_status_t test_transparent_cipher_setup(
102 mbedtls_operation_t direction,
Steven Cooreman37941cb2020-07-28 18:49:51 +0200103 test_transparent_cipher_operation_t *operation,
104 const psa_key_attributes_t *attributes,
105 const uint8_t *key, size_t key_length,
106 psa_algorithm_t alg)
107{
Steven Cooreman8b122252020-09-03 15:30:32 +0200108 const mbedtls_cipher_info_t *cipher_info = NULL;
109 int ret = 0;
Steven Cooreman37941cb2020-07-28 18:49:51 +0200110
Steven Cooremanacb5a102020-09-08 14:06:57 +0200111 test_driver_cipher_hooks.hits++;
Steven Cooreman8b122252020-09-03 15:30:32 +0200112
113 if( operation->alg != 0 )
Steven Cooremanacb5a102020-09-08 14:06:57 +0200114 return( PSA_ERROR_BAD_STATE );
Steven Cooreman8b122252020-09-03 15:30:32 +0200115
Steven Cooreman5240e8b2020-09-09 11:51:45 +0200116 /* Wiping the entire struct here, instead of member-by-member. This is useful
117 * for the test suite, since it gives a chance of catching memory corruption
118 * errors should the core not have allocated (enough) memory for our context
119 * struct. */
120 memset( operation, 0, sizeof( *operation ) );
Steven Cooreman8b122252020-09-03 15:30:32 +0200121
122 /* Test driver supports AES-CTR only, to verify operation calls. */
Steven Cooremanacb5a102020-09-08 14:06:57 +0200123 if( alg != PSA_ALG_CTR ||
124 psa_get_key_type( attributes ) != PSA_KEY_TYPE_AES )
125 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman8b122252020-09-03 15:30:32 +0200126
127 operation->alg = alg;
128 operation->iv_size = 16;
Steven Cooreman8b122252020-09-03 15:30:32 +0200129
130 cipher_info = mbedtls_cipher_info_from_values( MBEDTLS_CIPHER_ID_AES,
131 key_length * 8,
132 MBEDTLS_MODE_CTR );
133 if( cipher_info == NULL )
Steven Cooremanacb5a102020-09-08 14:06:57 +0200134 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman8b122252020-09-03 15:30:32 +0200135
136 mbedtls_cipher_init( &operation->cipher );
Steven Cooreman8b122252020-09-03 15:30:32 +0200137 ret = mbedtls_cipher_setup( &operation->cipher, cipher_info );
138 if( ret != 0 ) {
139 mbedtls_cipher_free( &operation->cipher );
Steven Cooremanacb5a102020-09-08 14:06:57 +0200140 return( mbedtls_to_psa_error( ret ) );
Steven Cooreman8b122252020-09-03 15:30:32 +0200141 }
142
143 ret = mbedtls_cipher_setkey( &operation->cipher,
144 key,
Steven Cooreman16afd3d2020-09-09 15:36:39 +0200145 key_length * 8, direction );
Steven Cooreman8b122252020-09-03 15:30:32 +0200146 if( ret != 0 ) {
147 mbedtls_cipher_free( &operation->cipher );
Steven Cooremanacb5a102020-09-08 14:06:57 +0200148 return( mbedtls_to_psa_error( ret ) );
Steven Cooreman8b122252020-09-03 15:30:32 +0200149 }
150
151 operation->iv_set = 0;
152 operation->iv_required = 1;
153 operation->key_set = 1;
154
155 /* Allow overriding return value for testing purposes */
Steven Cooremanacb5a102020-09-08 14:06:57 +0200156 if( test_driver_cipher_hooks.forced_status != PSA_SUCCESS )
Steven Cooreman8b122252020-09-03 15:30:32 +0200157 mbedtls_cipher_free( &operation->cipher );
158
Steven Cooremanacb5a102020-09-08 14:06:57 +0200159 return( test_driver_cipher_hooks.forced_status );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200160}
161
Steven Cooreman16afd3d2020-09-09 15:36:39 +0200162psa_status_t test_transparent_cipher_encrypt_setup(
163 test_transparent_cipher_operation_t *operation,
164 const psa_key_attributes_t *attributes,
165 const uint8_t *key, size_t key_length,
166 psa_algorithm_t alg)
167{
168 return ( test_transparent_cipher_setup( MBEDTLS_ENCRYPT,
169 operation,
170 attributes,
171 key,
172 key_length,
173 alg ) );
174}
175
Steven Cooreman37941cb2020-07-28 18:49:51 +0200176psa_status_t test_transparent_cipher_decrypt_setup(
177 test_transparent_cipher_operation_t *operation,
178 const psa_key_attributes_t *attributes,
179 const uint8_t *key, size_t key_length,
180 psa_algorithm_t alg)
181{
Steven Cooreman16afd3d2020-09-09 15:36:39 +0200182 return ( test_transparent_cipher_setup( MBEDTLS_DECRYPT,
183 operation,
184 attributes,
185 key,
186 key_length,
187 alg ) );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200188}
189
190psa_status_t test_transparent_cipher_abort(
191 test_transparent_cipher_operation_t *operation)
192{
Steven Cooreman8b122252020-09-03 15:30:32 +0200193 if( operation->alg == 0 )
194 return( PSA_SUCCESS );
195 if( operation->alg != PSA_ALG_CTR )
196 return( PSA_ERROR_BAD_STATE );
197
198 mbedtls_cipher_free( &operation->cipher );
199
Steven Cooreman5240e8b2020-09-09 11:51:45 +0200200 /* Wiping the entire struct here, instead of member-by-member. This is useful
201 * for the test suite, since it gives a chance of catching memory corruption
202 * errors should the core not have allocated (enough) memory for our context
203 * struct. */
204 memset( operation, 0, sizeof( *operation ) );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200205
Steven Cooremanacb5a102020-09-08 14:06:57 +0200206 test_driver_cipher_hooks.hits++;
207 return( PSA_SUCCESS );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200208}
209
210psa_status_t test_transparent_cipher_generate_iv(
211 test_transparent_cipher_operation_t *operation,
212 uint8_t *iv,
213 size_t iv_size,
214 size_t *iv_length)
215{
Steven Cooreman8b122252020-09-03 15:30:32 +0200216 psa_status_t status;
217 mbedtls_test_rnd_pseudo_info rnd_info;
218 memset( &rnd_info, 0x5A, sizeof( mbedtls_test_rnd_pseudo_info ) );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200219
Steven Cooremanacb5a102020-09-08 14:06:57 +0200220 test_driver_cipher_hooks.hits++;
Steven Cooreman8b122252020-09-03 15:30:32 +0200221
222 if( operation->alg != PSA_ALG_CTR )
223 return( PSA_ERROR_BAD_STATE );
224
225 if( operation->iv_set || ! operation->iv_required )
226 return( PSA_ERROR_BAD_STATE );
227
228 if( iv_size < operation->iv_size )
229 return( PSA_ERROR_BUFFER_TOO_SMALL );
230
231 status = mbedtls_to_psa_error(
232 mbedtls_test_rnd_pseudo_rand( &rnd_info,
233 iv,
234 operation->iv_size ) );
235 if( status != PSA_SUCCESS )
Steven Cooremanacb5a102020-09-08 14:06:57 +0200236 return( status );
Steven Cooreman8b122252020-09-03 15:30:32 +0200237
238 *iv_length = operation->iv_size;
239 status = test_transparent_cipher_set_iv( operation, iv, *iv_length );
240
Steven Cooremanacb5a102020-09-08 14:06:57 +0200241 return( status );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200242}
243
244psa_status_t test_transparent_cipher_set_iv(
245 test_transparent_cipher_operation_t *operation,
246 const uint8_t *iv,
247 size_t iv_length)
248{
Steven Cooreman8b122252020-09-03 15:30:32 +0200249 psa_status_t status;
Steven Cooreman37941cb2020-07-28 18:49:51 +0200250
Steven Cooremanacb5a102020-09-08 14:06:57 +0200251 test_driver_cipher_hooks.hits++;
Steven Cooreman8b122252020-09-03 15:30:32 +0200252
253 if( operation->alg != PSA_ALG_CTR )
Steven Cooremanacb5a102020-09-08 14:06:57 +0200254 return( PSA_ERROR_BAD_STATE );
Steven Cooreman8b122252020-09-03 15:30:32 +0200255
256 if( operation->iv_set || ! operation->iv_required )
257 return( PSA_ERROR_BAD_STATE );
258
259 if( iv_length != operation->iv_size )
260 return( PSA_ERROR_INVALID_ARGUMENT );
261
262 status = mbedtls_to_psa_error(
263 mbedtls_cipher_set_iv( &operation->cipher, iv, iv_length ) );
264
265 if( status == PSA_SUCCESS )
266 operation->iv_set = 1;
267
Steven Cooremanacb5a102020-09-08 14:06:57 +0200268 return( status );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200269}
270
271psa_status_t test_transparent_cipher_update(
272 test_transparent_cipher_operation_t *operation,
273 const uint8_t *input,
274 size_t input_length,
275 uint8_t *output,
276 size_t output_size,
277 size_t *output_length)
278{
Steven Cooreman8b122252020-09-03 15:30:32 +0200279 psa_status_t status;
280
Steven Cooremanacb5a102020-09-08 14:06:57 +0200281 test_driver_cipher_hooks.hits++;
Steven Cooreman37941cb2020-07-28 18:49:51 +0200282
Steven Cooreman8b122252020-09-03 15:30:32 +0200283 if( operation->alg != PSA_ALG_CTR )
284 return( PSA_ERROR_BAD_STATE );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200285
Steven Cooreman16afd3d2020-09-09 15:36:39 +0200286 /* CTR is a stream cipher, so data in and out are always the same size */
287 if( output_size < input_length )
Steven Cooreman8b122252020-09-03 15:30:32 +0200288 return( PSA_ERROR_BUFFER_TOO_SMALL );
289
290 status = mbedtls_to_psa_error(
291 mbedtls_cipher_update( &operation->cipher, input,
292 input_length, output, output_length ) );
293
294 if( status != PSA_SUCCESS )
295 return status;
296
Steven Cooremanacb5a102020-09-08 14:06:57 +0200297 if( test_driver_cipher_hooks.forced_output != NULL )
Steven Cooreman8b122252020-09-03 15:30:32 +0200298 {
Steven Cooremanacb5a102020-09-08 14:06:57 +0200299 if( output_size < test_driver_cipher_hooks.forced_output_length )
Steven Cooreman8b122252020-09-03 15:30:32 +0200300 return PSA_ERROR_BUFFER_TOO_SMALL;
301
Steven Cooremanacb5a102020-09-08 14:06:57 +0200302 memcpy( output,
303 test_driver_cipher_hooks.forced_output,
304 test_driver_cipher_hooks.forced_output_length );
305 *output_length = test_driver_cipher_hooks.forced_output_length;
Steven Cooreman8b122252020-09-03 15:30:32 +0200306 }
Steven Cooreman37941cb2020-07-28 18:49:51 +0200307
Steven Cooremanacb5a102020-09-08 14:06:57 +0200308 return( test_driver_cipher_hooks.forced_status );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200309}
310
311psa_status_t test_transparent_cipher_finish(
312 test_transparent_cipher_operation_t *operation,
313 uint8_t *output,
314 size_t output_size,
315 size_t *output_length)
316{
Steven Cooreman8b122252020-09-03 15:30:32 +0200317 psa_status_t status = PSA_ERROR_GENERIC_ERROR;
318 uint8_t temp_output_buffer[MBEDTLS_MAX_BLOCK_LENGTH];
319
Steven Cooremanacb5a102020-09-08 14:06:57 +0200320 test_driver_cipher_hooks.hits++;
Steven Cooreman37941cb2020-07-28 18:49:51 +0200321
Steven Cooreman8b122252020-09-03 15:30:32 +0200322 if( operation->alg != PSA_ALG_CTR )
323 return( PSA_ERROR_BAD_STATE );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200324
Steven Cooreman8b122252020-09-03 15:30:32 +0200325 if( ! operation->key_set )
326 return( PSA_ERROR_BAD_STATE );
327
328 if( operation->iv_required && ! operation->iv_set )
329 return( PSA_ERROR_BAD_STATE );
330
331 status = mbedtls_to_psa_error(
332 mbedtls_cipher_finish( &operation->cipher,
333 temp_output_buffer,
334 output_length ) );
335
336 mbedtls_cipher_free( &operation->cipher );
337
338 if( status != PSA_SUCCESS )
339 return( status );
340
341 if( *output_length == 0 )
342 ; /* Nothing to copy. Note that output may be NULL in this case. */
343 else if( output_size >= *output_length )
344 memcpy( output, temp_output_buffer, *output_length );
345 else
346 return( PSA_ERROR_BUFFER_TOO_SMALL );
347
348
Steven Cooremanacb5a102020-09-08 14:06:57 +0200349 if( test_driver_cipher_hooks.forced_output != NULL )
Steven Cooreman8b122252020-09-03 15:30:32 +0200350 {
Steven Cooremanacb5a102020-09-08 14:06:57 +0200351 if( output_size < test_driver_cipher_hooks.forced_output_length )
Steven Cooreman8b122252020-09-03 15:30:32 +0200352 return PSA_ERROR_BUFFER_TOO_SMALL;
353
Steven Cooremanacb5a102020-09-08 14:06:57 +0200354 memcpy( output,
355 test_driver_cipher_hooks.forced_output,
356 test_driver_cipher_hooks.forced_output_length );
357 *output_length = test_driver_cipher_hooks.forced_output_length;
Steven Cooreman8b122252020-09-03 15:30:32 +0200358 }
Steven Cooreman37941cb2020-07-28 18:49:51 +0200359
Steven Cooremanacb5a102020-09-08 14:06:57 +0200360 return( test_driver_cipher_hooks.forced_status );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200361}
362
363/*
364 * opaque versions, to do
365 */
366psa_status_t test_opaque_cipher_encrypt(
367 const psa_key_attributes_t *attributes,
368 const uint8_t *key, size_t key_length,
369 psa_algorithm_t alg,
370 const uint8_t *input, size_t input_length,
371 uint8_t *output, size_t output_size, size_t *output_length)
372{
373 (void) attributes;
374 (void) key;
375 (void) key_length;
376 (void) alg;
377 (void) input;
378 (void) input_length;
379 (void) output;
380 (void) output_size;
381 (void) output_length;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200382 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200383}
384
385psa_status_t test_opaque_cipher_decrypt(
386 const psa_key_attributes_t *attributes,
387 const uint8_t *key, size_t key_length,
388 psa_algorithm_t alg,
389 const uint8_t *input, size_t input_length,
390 uint8_t *output, size_t output_size, size_t *output_length)
391{
392 (void) attributes;
393 (void) key;
394 (void) key_length;
395 (void) alg;
396 (void) input;
397 (void) input_length;
398 (void) output;
399 (void) output_size;
400 (void) output_length;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200401 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200402}
403
404psa_status_t test_opaque_cipher_encrypt_setup(
405 test_opaque_cipher_operation_t *operation,
406 const psa_key_attributes_t *attributes,
407 const uint8_t *key, size_t key_length,
408 psa_algorithm_t alg)
409{
410 (void) operation;
411 (void) attributes;
412 (void) key;
413 (void) key_length;
414 (void) alg;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200415 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200416}
417
418psa_status_t test_opaque_cipher_decrypt_setup(
419 test_opaque_cipher_operation_t *operation,
420 const psa_key_attributes_t *attributes,
421 const uint8_t *key, size_t key_length,
422 psa_algorithm_t alg)
423{
424 (void) operation;
425 (void) attributes;
426 (void) key;
427 (void) key_length;
428 (void) alg;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200429 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200430}
431
432psa_status_t test_opaque_cipher_abort(
433 test_opaque_cipher_operation_t *operation)
434{
435 (void) operation;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200436 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200437}
438
439psa_status_t test_opaque_cipher_generate_iv(
440 test_opaque_cipher_operation_t *operation,
441 uint8_t *iv,
442 size_t iv_size,
443 size_t *iv_length)
444{
445 (void) operation;
446 (void) iv;
447 (void) iv_size;
448 (void) iv_length;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200449 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200450}
451
452psa_status_t test_opaque_cipher_set_iv(
453 test_opaque_cipher_operation_t *operation,
454 const uint8_t *iv,
455 size_t iv_length)
456{
457 (void) operation;
458 (void) iv;
459 (void) iv_length;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200460 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200461}
462
463psa_status_t test_opaque_cipher_update(
464 test_opaque_cipher_operation_t *operation,
465 const uint8_t *input,
466 size_t input_length,
467 uint8_t *output,
468 size_t output_size,
469 size_t *output_length)
470{
471 (void) operation;
472 (void) input;
473 (void) input_length;
474 (void) output;
475 (void) output_size;
476 (void) output_length;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200477 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200478}
479
480psa_status_t test_opaque_cipher_finish(
481 test_opaque_cipher_operation_t *operation,
482 uint8_t *output,
483 size_t output_size,
484 size_t *output_length)
485{
486 (void) operation;
487 (void) output;
488 (void) output_size;
489 (void) output_length;
Steven Cooremanacb5a102020-09-08 14:06:57 +0200490 return( PSA_ERROR_NOT_SUPPORTED );
Steven Cooreman37941cb2020-07-28 18:49:51 +0200491}
492#endif /* MBEDTLS_PSA_CRYPTO_DRIVERS && PSA_CRYPTO_DRIVER_TEST */