blob: 1607ba5124c54201d25f8d9ca2ec10c833cc1de5 [file] [log] [blame]
Steven Cooremana70d5882020-07-16 20:26:18 +02001/*
2 * Test driver for signature functions
3 */
4/* Copyright (C) 2020, ARM Limited, All Rights Reserved
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 * This file is part of mbed TLS (https://tls.mbed.org)
20 */
21
22#ifndef MBEDTLS_PSA_CRYPTO_TEST_DRIVERS_SIGNATURE_H
23#define MBEDTLS_PSA_CRYPTO_TEST_DRIVERS_SIGNATURE_H
24
25#if !defined(MBEDTLS_CONFIG_FILE)
26#include "mbedtls/config.h"
27#else
28#include MBEDTLS_CONFIG_FILE
29#endif
30
31#if defined(MBEDTLS_TEST_HOOKS)
32#include <psa/crypto_driver_common.h>
33
34extern void *test_driver_forced_output;
35extern size_t test_driver_forced_output_length;
36
37extern psa_status_t test_transparent_signature_sign_hash_status;
38extern unsigned long test_transparent_signature_sign_hash_hit;
39
40psa_status_t test_transparent_signature_sign_hash(
41 const psa_key_attributes_t *attributes,
42 const uint8_t *key, size_t key_length,
43 psa_algorithm_t alg,
44 const uint8_t *hash, size_t hash_length,
45 uint8_t *signature, size_t signature_size, size_t *signature_length );
46
47psa_status_t test_opaque_signature_sign_hash(
48 const psa_key_attributes_t *attributes,
49 const uint8_t *key, size_t key_length,
50 psa_algorithm_t alg,
51 const uint8_t *hash, size_t hash_length,
52 uint8_t *signature, size_t signature_size, size_t *signature_length );
53
54#endif /* MBEDTLS_TEST_HOOKS */
55#endif /* MBEDTLS_PSA_CRYPTO_TEST_DRIVERS_SIGNATURE_H */