summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2018-03-14 19:10:01 +0100
committerUros Majstorovic <majstor@majstor.org>2018-03-14 19:10:01 +0100
commit2570f27d69bb85b814b497e3daeaaa28425bf18a (patch)
tree83daa6cd02c143e6150747baa46a5de448c92d08 /code
parent5fe913c88d8c1781de336cca3949142bd9fc370d (diff)
removed assert from arc4random
Diffstat (limited to 'code')
-rw-r--r--code/ecp/crypto/Makefile9
-rwxr-xr-xcode/ecp/crypto/arc4random/arc4random.c7
2 files changed, 7 insertions, 9 deletions
diff --git a/code/ecp/crypto/Makefile b/code/ecp/crypto/Makefile
index 36ecbfc..45a1e2d 100644
--- a/code/ecp/crypto/Makefile
+++ b/code/ecp/crypto/Makefile
@@ -1,10 +1,13 @@
include ../Makefile.platform
CFLAGS=$(CFLAGS_PL) $(PIC) -Iinclude -I.. -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS=
-obj = e_chacha20poly1305.o crypto.o
+obj = crypto.o e_chacha20poly1305.o
obj_dep = compat/explicit_bzero.o compat/timingsafe_memcmp.o compat/timingsafe_bcmp.o \
- chacha/chacha.o poly1305/poly1305.o curve25519/curve25519.o curve25519/curve25519-generic.o \
- sha/sha256.o sha/sha512.o arc4random/arc4random.o
+ chacha/chacha.o poly1305/poly1305.o \
+ curve25519/curve25519.o curve25519/curve25519-generic.o \
+ sha/sha256.o sha/sha512.o \
+ arc4random/arc4random.o
+
subdirs = compat curve25519 chacha poly1305 sha 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 <stdlib.h>
#include <string.h>
#include <sys/types.h>
-#include <assert.h>
#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 */