mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-10 23:55:35 -04:00
Improve readability with less negation.
Err, I mean don't worsen readability by not using more negation. Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
06e1fcdb45
commit
08b2ebd2be
@ -643,8 +643,9 @@ mbedtls_pk_type_t mbedtls_pk_get_type( const mbedtls_pk_context *ctx );
|
|||||||
*/
|
*/
|
||||||
static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk )
|
static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk )
|
||||||
{
|
{
|
||||||
return( mbedtls_pk_get_type( &pk ) != MBEDTLS_PK_RSA ? NULL :
|
return( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_RSA ?
|
||||||
(mbedtls_rsa_context *) (pk).pk_ctx );
|
(mbedtls_rsa_context *) (pk).pk_ctx :
|
||||||
|
NULL );
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_RSA_C */
|
#endif /* MBEDTLS_RSA_C */
|
||||||
|
|
||||||
@ -662,10 +663,11 @@ static inline mbedtls_rsa_context *mbedtls_pk_rsa( const mbedtls_pk_context pk )
|
|||||||
*/
|
*/
|
||||||
static inline mbedtls_ecp_keypair *mbedtls_pk_ec( const mbedtls_pk_context pk )
|
static inline mbedtls_ecp_keypair *mbedtls_pk_ec( const mbedtls_pk_context pk )
|
||||||
{
|
{
|
||||||
return( mbedtls_pk_get_type( &pk ) != MBEDTLS_PK_ECKEY &&
|
return( mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY ||
|
||||||
mbedtls_pk_get_type( &pk ) != MBEDTLS_PK_ECKEY_DH &&
|
mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECKEY_DH ||
|
||||||
mbedtls_pk_get_type( &pk ) != MBEDTLS_PK_ECDSA ? NULL :
|
mbedtls_pk_get_type( &pk ) == MBEDTLS_PK_ECDSA ?
|
||||||
(mbedtls_ecp_keypair *) (pk).pk_ctx );
|
(mbedtls_ecp_keypair *) (pk).pk_ctx :
|
||||||
|
NULL );
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_ECP_C */
|
#endif /* MBEDTLS_ECP_C */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user