diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index 1b3b1da1fd357ed66e55394d667677ba992cd53e..0fac8ffc2fb7ef5dc6d39cca05d0292b584bb472 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c @@ -161,7 +161,7 @@ static int _get_more_prng_bytes(struct prng_context *ctx) /* * Now update our DT value */ - for (i = 0; i < DEFAULT_BLK_SZ; i++) { + for (i = DEFAULT_BLK_SZ - 1; i >= 0; i--) { ctx->DT[i] += 1; if (ctx->DT[i] != 0) break;