mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-18 05:42:35 +00:00
rsa.c: provide interface to get padding mode of RSA context
Signed-off-by: Yanray Wang <yanray.wang@arm.com>
This commit is contained in:
parent
228a30d16c
commit
a730df6f86
@ -181,6 +181,16 @@ void mbedtls_rsa_init(mbedtls_rsa_context *ctx);
|
|||||||
int mbedtls_rsa_set_padding(mbedtls_rsa_context *ctx, int padding,
|
int mbedtls_rsa_set_padding(mbedtls_rsa_context *ctx, int padding,
|
||||||
mbedtls_md_type_t hash_id);
|
mbedtls_md_type_t hash_id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief This function retrieves padding mode of RSA modulus.
|
||||||
|
*
|
||||||
|
* \param ctx The initialized RSA context.
|
||||||
|
*
|
||||||
|
* \return RSA padding mode.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int mbedtls_rsa_get_padding_mode(const mbedtls_rsa_context *ctx);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief This function imports a set of core parameters into an
|
* \brief This function imports a set of core parameters into an
|
||||||
* RSA context.
|
* RSA context.
|
||||||
|
@ -499,10 +499,17 @@ int mbedtls_rsa_set_padding(mbedtls_rsa_context *ctx, int padding,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get padding mode of RSA modulus
|
||||||
|
*/
|
||||||
|
int mbedtls_rsa_get_padding_mode(const mbedtls_rsa_context *ctx)
|
||||||
|
{
|
||||||
|
return ctx->MBEDTLS_PRIVATE(padding);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get length in bytes of RSA modulus
|
* Get length in bytes of RSA modulus
|
||||||
*/
|
*/
|
||||||
|
|
||||||
size_t mbedtls_rsa_get_len(const mbedtls_rsa_context *ctx)
|
size_t mbedtls_rsa_get_len(const mbedtls_rsa_context *ctx)
|
||||||
{
|
{
|
||||||
return ctx->len;
|
return ctx->len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user