keylara_chacha20 (keylara v1.0.0)
Summary
Functions
Decrypt data using ChaCha20 with counter = 0
Decrypt data using ChaCha20 with specified counter
Encrypt data using ChaCha20 with counter = 0
Encrypt data using ChaCha20 with specified counter
Generate ChaCha20 key using Alara distributed entropy
Generate ChaCha20 nonce using Alara distributed entropy
Get ChaCha20 key size in bytes
Get ChaCha20 nonce size in bytes
Validate ChaCha20 key format and size
Validate ChaCha20 nonce format and size
Types
-type chacha20_counter() :: non_neg_integer().
-type chacha20_key() :: binary().
-type chacha20_nonce() :: binary().
-type keylara_error() :: {error, term()}.
Functions
-spec decrypt(binary(), chacha20_key(), chacha20_nonce()) -> {ok, binary()} | keylara_error().
Decrypt data using ChaCha20 with counter = 0
-spec decrypt(binary(), chacha20_key(), chacha20_nonce(), chacha20_counter()) -> {ok, binary()} | keylara_error().
Decrypt data using ChaCha20 with specified counter
-spec encrypt(binary(), chacha20_key(), chacha20_nonce()) -> {ok, binary()} | keylara_error().
Encrypt data using ChaCha20 with counter = 0
-spec encrypt(binary(), chacha20_key(), chacha20_nonce(), chacha20_counter()) -> {ok, binary()} | keylara_error().
Encrypt data using ChaCha20 with specified counter
-spec generate_key(pid()) -> {ok, chacha20_key()} | keylara_error().
Generate ChaCha20 key using Alara distributed entropy
-spec generate_nonce(pid()) -> {ok, chacha20_nonce()} | keylara_error().
Generate ChaCha20 nonce using Alara distributed entropy
-spec get_key_size() -> integer().
Get ChaCha20 key size in bytes
-spec get_nonce_size() -> integer().
Get ChaCha20 nonce size in bytes
-spec validate_key(term()) -> ok | keylara_error().
Validate ChaCha20 key format and size
-spec validate_nonce(term()) -> ok | keylara_error().
Validate ChaCha20 nonce format and size