diff options
author | Raimo Niskanen <[email protected]> | 2017-09-28 14:48:44 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2017-09-28 17:01:14 +0200 |
commit | 7710c0d681a4b5f17253945dde0726de0e27cdcf (patch) | |
tree | 9904a7c8fd58dd961a352cc3240f48e0ec4a0650 /lib/crypto/doc | |
parent | 29222f06f38e321e5a2ac8dae67ced92b6544bde (diff) | |
download | otp-7710c0d681a4b5f17253945dde0726de0e27cdcf.tar.gz otp-7710c0d681a4b5f17253945dde0726de0e27cdcf.tar.bz2 otp-7710c0d681a4b5f17253945dde0726de0e27cdcf.zip |
Make cache size configurable
Diffstat (limited to 'lib/crypto/doc')
-rw-r--r-- | lib/crypto/doc/src/crypto.xml | 14 | ||||
-rw-r--r-- | lib/crypto/doc/src/crypto_app.xml | 18 |
2 files changed, 32 insertions, 0 deletions
diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 5afab632cd..c32e3430ab 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -800,6 +800,7 @@ _FloatValue = rand:uniform(). % [0.0; 1.0[</pre> <v>Alg = crypto | crypto_cache</v> </type> <desc> + <marker id="rand_seed_alg-1" /> <p> Creates state object for <seealso marker="stdlib:rand">random number generation</seealso>, @@ -814,6 +815,12 @@ _FloatValue = rand:uniform(). % [0.0; 1.0[</pre> may throw exception <c>low_entropy</c> in case the random generator failed due to lack of secure "randomness". </p> + <p> + The cache size can be changed from its default value using the + <seealso marker="crypto_app"> + crypto app's + </seealso> configuration parameter <c>rand_cache_size</c>. + </p> <p><em>Example</em></p> <pre> _ = crypto:rand_seed_alg(crypto_cache), @@ -829,6 +836,7 @@ _FloatValue = rand:uniform(). % [0.0; 1.0[</pre> <v>Alg = crypto | crypto_cache</v> </type> <desc> + <marker id="rand_seed_alg_s-1" /> <p> Creates state object for <seealso marker="stdlib:rand">random number generation</seealso>, @@ -852,6 +860,12 @@ _FloatValue = rand:uniform(). % [0.0; 1.0[</pre> may throw exception <c>low_entropy</c> in case the random generator failed due to lack of secure "randomness". </p> + <p> + The cache size can be changed from its default value using the + <seealso marker="crypto_app"> + crypto app's + </seealso> configuration parameter <c>rand_cache_size</c>. + </p> <note> <p> The state returned from this function can not be used diff --git a/lib/crypto/doc/src/crypto_app.xml b/lib/crypto/doc/src/crypto_app.xml index ba22557480..8296b1bc77 100644 --- a/lib/crypto/doc/src/crypto_app.xml +++ b/lib/crypto/doc/src/crypto_app.xml @@ -68,6 +68,24 @@ thus the crypto module will fail to load. This mechanism prevents the accidental use of non-validated algorithms.</p> </item> + <tag><c>rand_cache_size = integer()</c></tag> + <item> + <p> + Sets the cache size in bytes to use by + <seealso marker="crypto#rand_seed_alg-1"> + <c>crypto:rand_seed_alg(crypto_cache)</c> + </seealso> and + <seealso marker="crypto#rand_seed_alg_s-1"> + <c>crypto:rand_seed_alg_s(crypto_cache)</c> + </seealso>. + This parameter is read when a seed function is called, + and then kept in generators state object. It has a rather + small default value that causes reads of strong random bytes + about once per hundred calls for a random value. + The set value is rounded up to an integral number of words + of the size these seed functions use. + </p> + </item> </taglist> </section> |