diff --git a/library/bignum.c b/library/bignum.c index 76202fe51..521787d74 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -1933,10 +1933,9 @@ cleanup: /* * Fill X with size bytes of random. - * - * Use a temporary bytes representation to make sure the result is the same - * regardless of the platform endianness (useful when f_rng is actually - * deterministic, eg for tests). + * The bytes returned from the RNG are used in a specific order which + * is suitable for deterministic ECDSA (see the specification of + * mbedtls_mpi_random() and the implementation in mbedtls_mpi_fill_random()). */ int mbedtls_mpi_fill_random( mbedtls_mpi *X, size_t size, int (*f_rng)(void *, unsigned char *, size_t), diff --git a/library/bignum_core.c b/library/bignum_core.c index e40599596..b990a8dcc 100644 --- a/library/bignum_core.c +++ b/library/bignum_core.c @@ -557,9 +557,8 @@ void mbedtls_mpi_core_ct_uint_table_lookup( mbedtls_mpi_uint *dest, /* Fill X with n_bytes random bytes. * X must already have room for those bytes. * The ordering of the bytes returned from the RNG is suitable for - * deterministic ECDSA (see RFC 6979 §3.3 and mbedtls_mpi_core_random()). - * The size and sign of X are unchanged. - * n_bytes must not be 0. + * deterministic ECDSA (see RFC 6979 §3.3 and the specification of + * mbedtls_mpi_core_random()). */ int mbedtls_mpi_core_fill_random( mbedtls_mpi_uint *X, size_t X_limbs,