mirror of
https://github.com/cuberite/polarssl.git
synced 2025-10-03 02:23:32 -04:00
Use PSA_BITS_TO_BYTES instead of open-coded calculation in mbedtls_pk_wrap_as_opaque()
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
parent
b354742371
commit
7e1b4a45fa
@ -728,7 +728,7 @@ int mbedtls_pk_wrap_as_opaque( mbedtls_pk_context *pk,
|
|||||||
|
|
||||||
/* export the private key material in the format PSA wants */
|
/* export the private key material in the format PSA wants */
|
||||||
ec = mbedtls_pk_ec( *pk );
|
ec = mbedtls_pk_ec( *pk );
|
||||||
d_len = ( ec->grp.nbits + 7 ) / 8;
|
d_len = PSA_BITS_TO_BYTES( ec->grp.nbits );
|
||||||
if( ( ret = mbedtls_mpi_write_binary( &ec->d, d, d_len ) ) != 0 )
|
if( ( ret = mbedtls_mpi_write_binary( &ec->d, d, d_len ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user