From 2570f27d69bb85b814b497e3daeaaa28425bf18a Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Wed, 14 Mar 2018 19:10:01 +0100 Subject: removed assert from arc4random --- code/ecp/crypto/arc4random/arc4random.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'code/ecp/crypto/arc4random') diff --git a/code/ecp/crypto/arc4random/arc4random.c b/code/ecp/crypto/arc4random/arc4random.c index e891dd6..23ce9b7 100755 --- a/code/ecp/crypto/arc4random/arc4random.c +++ b/code/ecp/crypto/arc4random/arc4random.c @@ -29,7 +29,6 @@ #include #include #include -#include #define ARC4R_KEYSZ 32 #define ARC4R_IVSZ 8 @@ -66,8 +65,6 @@ static int (*getentropy) (void* buf, size_t n); static inline void _rs_init(rand_state* st, u8 *buf, size_t n) { - assert(n >= (ARC4R_KEYSZ + ARC4R_IVSZ)); - chacha_keysetup(&st->rs_chacha, buf, ARC4R_KEYSZ * 8, 0); chacha_ivsetup(&st->rs_chacha, buf + ARC4R_KEYSZ); } @@ -104,9 +101,7 @@ _rs_stir(rand_state* st) u8 rnd[ARC4R_KEYSZ + ARC4R_IVSZ]; - int r = getentropy(rnd, sizeof rnd); - assert(r == 0); - + getentropy(rnd, sizeof rnd); _rs_rekey(st, rnd, sizeof(rnd)); /* invalidate rs_buf */ -- cgit v1.2.3