blob: 4081ac6398378763f03cb9325a1f871486b73c19 [file] [log] [blame]
Tomi Fontanilles573dc232023-12-10 14:57:51 +02001/**
2 * \file rsa_internal.h
3 *
4 * \brief Internal-only RSA public-key cryptosystem API.
5 *
6 * This file declares RSA-related functions that are to be used
7 * only from within the Mbed TLS library itself.
8 *
9 */
10/*
11 * Copyright The Mbed TLS Contributors
12 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
13 */
14#ifndef MBEDTLS_RSA_INTERNAL_H
15#define MBEDTLS_RSA_INTERNAL_H
16
17#include "mbedtls/rsa.h"
18
19#if defined(MBEDTLS_PKCS1_V21)
20/**
21 * \brief This function is analogue to \c mbedtls_rsa_rsassa_pss_sign().
22 * The only difference between them is that this function is more flexible
23 * on the parameters of \p ctx that are set with \c mbedtls_rsa_set_padding().
24 *
25 * \note Compared to its counterpart, this function:
26 * - does not check the padding setting of \p ctx.
27 * - allows the hash_id of \p ctx to be MBEDTLS_MD_NONE,
28 * in which case it uses \p md_alg as the hash_id.
29 *
30 * \note Refer to \c mbedtls_rsa_rsassa_pss_sign() for a description
31 * of the functioning and parameters of this function.
32 */
33int mbedtls_rsa_rsassa_pss_sign_no_mode_check(mbedtls_rsa_context *ctx,
34 int (*f_rng)(void *, unsigned char *, size_t),
35 void *p_rng,
36 mbedtls_md_type_t md_alg,
37 unsigned int hashlen,
38 const unsigned char *hash,
39 unsigned char *sig);
40#endif /* MBEDTLS_PKCS1_V21 */
41
42#endif /* rsa_internal.h */