Provide a type specification of enacl:randombytes/1

This commit is contained in:
Jesper Louis Andersen 2014-12-12 02:45:12 +01:00
parent fd9f421621
commit b109ff7834

View File

@ -501,6 +501,7 @@ onetime_auth_key_size() -> enacl_nif:crypto_onetimeauth_KEYBYTES().
%% It is up to you to pick a system with a appropriately strong (P)RNG for your purpose. We refer %% It is up to you to pick a system with a appropriately strong (P)RNG for your purpose. We refer
%% you to the underlying system implementations for random data. %% you to the underlying system implementations for random data.
%% @end %% @end
-spec randombytes(non_neg_integer()) -> binary().
randombytes(N) when N =< ?RANDOMBYTES_SIZE -> randombytes(N) when N =< ?RANDOMBYTES_SIZE ->
bump(enacl_nif:randombytes_b(N), ?RANDOMBYTES_REDUCTIONS, ?RANDOMBYTES_SIZE, N); bump(enacl_nif:randombytes_b(N), ?RANDOMBYTES_REDUCTIONS, ?RANDOMBYTES_SIZE, N);
randombytes(N) -> randombytes(N) ->