Include openssl/chacha.h rather than duplicate the prototype.
Less chance of problems should the prototype ever change. This doesn't
make it any more or less a circular dependency. (It actually isn't;
crypto/chacha doesn't use crypto/rand and CMakeLists.txt actually puts
rand above chacha anyway.)
Change-Id: Ia80289f801f76551737233f158755aac99ddd74a
Reviewed-on: https://boringssl-review.googlesource.com/5262
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/rand/rand.c b/crypto/rand/rand.c
index daebdf0..0d146a8 100644
--- a/crypto/rand/rand.c
+++ b/crypto/rand/rand.c
@@ -17,6 +17,7 @@
#include <limits.h>
#include <string.h>
+#include <openssl/chacha.h>
#include <openssl/mem.h>
#include "internal.h"
@@ -69,10 +70,6 @@
OPENSSL_free(state);
}
-extern void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len,
- const uint8_t key[32], const uint8_t nonce[8],
- size_t counter);
-
int RAND_bytes(uint8_t *buf, size_t len) {
if (len == 0) {
return 1;