mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Add pk_rsa_set_padding() and rsa_set_padding()
This commit is contained in:
committed by
Paul Bakker
parent
7c59363a85
commit
b4fae579e8
14
library/pk.c
14
library/pk.c
@ -108,6 +108,20 @@ int pk_init_ctx( pk_context *ctx, const pk_info_t *info )
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Set RSA padding
|
||||
*/
|
||||
int pk_rsa_set_padding( pk_context *ctx, int padding, int hash_id )
|
||||
{
|
||||
if( ctx == NULL || ctx->pk_info == NULL ||
|
||||
ctx->pk_info->type != POLARSSL_PK_RSA )
|
||||
return( POLARSSL_ERR_PK_BAD_INPUT_DATA );
|
||||
|
||||
rsa_set_padding( pk_rsa( *ctx ), padding, hash_id );
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize an RSA-alt context
|
||||
*/
|
||||
|
Reference in New Issue
Block a user