mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-28 00:21:48 +03:00
Fix mpi_write_string() to write "00" as hex output for empty MPI
This commit is contained in:
@ -530,7 +530,7 @@ int mpi_write_string( const mpi *X, int radix, char *s, size_t *slen )
|
||||
{
|
||||
c = ( X->p[i - 1] >> ( ( j - 1 ) << 3) ) & 0xFF;
|
||||
|
||||
if( c == 0 && k == 0 && ( i + j + 3 ) != 0 )
|
||||
if( c == 0 && k == 0 && ( i + j ) != 2 )
|
||||
continue;
|
||||
|
||||
*(p++) = "0123456789ABCDEF" [c / 16];
|
||||
|
Reference in New Issue
Block a user