diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-11-25 12:28:20 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-11-25 22:29:59 -0500 |
commit | 1cfa2bc859c0a7f27b49b80dc1be4be2acc91ee8 (patch) | |
tree | 860ffab3294af301afe6c2c31239fd7df39094d6 /src/common | |
parent | ddcbe264745a0c10d80d8ad74125d23eb251662d (diff) | |
download | tor-1cfa2bc859c0a7f27b49b80dc1be4be2acc91ee8.tar.gz tor-1cfa2bc859c0a7f27b49b80dc1be4be2acc91ee8.zip |
Fix documentation for crypto_rand*
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/crypto.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 9e27ad30c4..9669493a83 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -2364,8 +2364,11 @@ crypto_seed_rng(void) return -1; } -/** Write <b>n</b> bytes of strong random data to <b>to</b>. Return 0 on - * success, -1 on failure, with support for mocking for unit tests. +/** Write <b>n</b> bytes of strong random data to <b>to</b>. Supports mocking + * for unit tests. + * + * This function is not allowed to fail; if it would fail to generate strong + * entropy, it must terminate the process instead. */ MOCK_IMPL(void, crypto_rand, (char *to, size_t n)) @@ -2373,8 +2376,11 @@ crypto_rand, (char *to, size_t n)) crypto_rand_unmocked(to, n); } -/** Write <b>n</b> bytes of strong random data to <b>to</b>. Return 0 on - * success, -1 on failure. Most callers will want crypto_rand instead. +/** Write <b>n</b> bytes of strong random data to <b>to</b>. Most callers + * will want crypto_rand instead. + * + * This function is not allowed to fail; if it would fail to generate strong + * entropy, it must terminate the process instead. */ void crypto_rand_unmocked(char *to, size_t n) |