mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-24 17:41:01 +03:00
PK: add nice interface functions
Also fix a const-corectness issue.
This commit is contained in:
@@ -53,9 +53,9 @@ static int rsa_can_do( pk_type_t type )
|
||||
return( type == POLARSSL_PK_RSA );
|
||||
}
|
||||
|
||||
static size_t rsa_get_size( void * ctx )
|
||||
static size_t rsa_get_size( const void * ctx )
|
||||
{
|
||||
return( mpi_size( &((rsa_context *) ctx)->N ) * 8 );
|
||||
return( 8 * ((rsa_context *) ctx)->len );
|
||||
}
|
||||
|
||||
static int rsa_verify_wrap( void *ctx,
|
||||
@@ -101,7 +101,7 @@ int ecdsa_can_do( pk_type_t type )
|
||||
return( type == POLARSSL_PK_ECDSA );
|
||||
}
|
||||
|
||||
static size_t ecdsa_get_size( void *ctx )
|
||||
static size_t ecdsa_get_size( const void *ctx )
|
||||
{
|
||||
return( ((ecdsa_context *) ctx)->grp.pbits );
|
||||
}
|
||||
@@ -152,7 +152,7 @@ static int eckey_can_do( pk_type_t type )
|
||||
type == POLARSSL_PK_ECDSA );
|
||||
}
|
||||
|
||||
static size_t eckey_get_size( void *ctx )
|
||||
static size_t eckey_get_size( const void *ctx )
|
||||
{
|
||||
return( ((ecp_keypair *) ctx)->grp.pbits );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user