diff --git a/library/ctr_drbg.c b/library/ctr_drbg.c index 1de7f05e9..8cf03712e 100644 --- a/library/ctr_drbg.c +++ b/library/ctr_drbg.c @@ -194,7 +194,7 @@ int ctr_drbg_update_internal( ctr_drbg_context *ctx, /* * Increase counter */ - for( i = CTR_DRBG_BLOCKSIZE; i >= 0; i-- ) + for( i = CTR_DRBG_BLOCKSIZE; i > 0; i-- ) if( ++ctx->counter[i - 1] != 0 ) break;