1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Merge pull request #7190 from yanrayw/6197_rsa_get_padding_hashID

RSA: provide interface to retrieve padding mode and hash_id
This commit is contained in:
Dave Rodgman
2023-03-20 18:34:53 +00:00
committed by GitHub
5 changed files with 73 additions and 1 deletions

View File

@ -502,10 +502,25 @@ int mbedtls_rsa_set_padding(mbedtls_rsa_context *ctx, int padding,
return 0;
}
/*
* Get padding mode of initialized RSA context
*/
int mbedtls_rsa_get_padding_mode(const mbedtls_rsa_context *ctx)
{
return ctx->padding;
}
/*
* Get hash identifier of mbedtls_md_type_t type
*/
int mbedtls_rsa_get_md_alg(const mbedtls_rsa_context *ctx)
{
return ctx->hash_id;
}
/*
* Get length in bytes of RSA modulus
*/
size_t mbedtls_rsa_get_len(const mbedtls_rsa_context *ctx)
{
return ctx->len;