aboutsummaryrefslogtreecommitdiff
path: root/src/common/crypto.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-03 23:31:07 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-02 14:11:13 -0500
commit25c05cb747eece7d720a3f79c172e83a0e79a3a1 (patch)
tree8aab82509ef888cbc2b385fb3275405ee0381577 /src/common/crypto.h
parent4d36eafd74e9c66a0dc76e5543a2aaabfa11f8b2 (diff)
downloadtor-25c05cb747eece7d720a3f79c172e83a0e79a3a1.tar.gz
tor-25c05cb747eece7d720a3f79c172e83a0e79a3a1.zip
Refactor strong os-RNG into its own function
Previously, we only used the strong OS entropy source as part of seeding OpenSSL's RNG. But with curve25519, we'll have occasion to want to generate some keys using extremely-good entopy, as well as the means to do so. So let's! This patch refactors the OS-entropy wrapper into its own crypto_strongest_rand() function, and makes our new curve25519_secret_key_generate function try it as appropriate.
Diffstat (limited to 'src/common/crypto.h')
-rw-r--r--src/common/crypto.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/common/crypto.h b/src/common/crypto.h
index 2d31e8d8bb..b6e8e6c560 100644
--- a/src/common/crypto.h
+++ b/src/common/crypto.h
@@ -252,6 +252,7 @@ int crypto_expand_key_material_rfc5869_sha256(
/* random numbers */
int crypto_seed_rng(int startup);
int crypto_rand(char *to, size_t n);
+int crypto_strongest_rand(uint8_t *out, size_t out_len);
int crypto_rand_int(unsigned int max);
uint64_t crypto_rand_uint64(uint64_t max);
double crypto_rand_double(void);