diff options
author | Hans Nilsson <hans@erlang.org> | 2021-09-27 13:41:23 +0200 |
---|---|---|
committer | Hans Nilsson <hans@erlang.org> | 2021-10-06 10:27:09 +0200 |
commit | b51754190f94d8da328f6fc0f0cc4622ccce8205 (patch) | |
tree | 89c8c383e0feec6a98570a9227f5f09db256c56d /lib/crypto | |
parent | 9962ca7b1d5a32780e9d0a13aaaa29f8d6574fed (diff) | |
download | erlang-b51754190f94d8da328f6fc0f0cc4622ccce8205.tar.gz |
crypto: Change some line breaks
Diffstat (limited to 'lib/crypto')
-rw-r--r-- | lib/crypto/src/crypto.erl | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index 1c081dd0f8..473be885c9 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -802,7 +802,8 @@ cipher_info(Type) -> State :: crypto_state() . crypto_init(Cipher, Key, FlagOrOptions) -> ?nif_call(ng_crypto_init_nif(alias(Cipher,Key), Key, <<>>, FlagOrOptions), - {1,2,-1,3}). + {1,2,-1,3} + ). -spec crypto_init(Cipher, Key, IV, FlagOrOptions) -> State | descriptive_error() when Cipher :: cipher_iv(), @@ -811,10 +812,7 @@ crypto_init(Cipher, Key, FlagOrOptions) -> FlagOrOptions :: crypto_opts(), State :: crypto_state() . crypto_init(Cipher, Key, IV, FlagOrOptions) -> - ?nif_call(ng_crypto_init_nif(alias(Cipher,Key), - Key, - IV, - FlagOrOptions)). + ?nif_call(ng_crypto_init_nif(alias(Cipher,Key), Key, IV, FlagOrOptions)). %%%---------------------------------------------------------------- -spec crypto_dyn_iv_init(Cipher, Key, FlagOrOptions) -> State | descriptive_error() @@ -824,14 +822,10 @@ crypto_init(Cipher, Key, IV, FlagOrOptions) -> State :: crypto_state() . crypto_dyn_iv_init(Cipher, Key, FlagOrOptions) -> %% The IV is supposed to be supplied by calling crypto_update/3 - ?nif_call( - ng_crypto_init_nif(alias(Cipher,Key), - Key, - undefined, - FlagOrOptions), - {1,2,-1,3} - ) - . + ?nif_call(ng_crypto_init_nif(alias(Cipher,Key), Key, undefined, FlagOrOptions), + [Cipher, Key, FlagOrOptions], + {1,2,-1,3} + ). %%%---------------------------------------------------------------- %%% @@ -893,13 +887,10 @@ crypto_get_data(State) -> Result :: binary() . crypto_one_time(Cipher, Key, Data, FlagOrOptions) -> - ?nif_call(ng_crypto_one_time_nif(alias(Cipher,Key), - Key, - <<>>, - Data, - FlagOrOptions), + ?nif_call(ng_crypto_one_time_nif(alias(Cipher,Key), Key, <<>>, Data, FlagOrOptions), [Cipher, Key, Data, FlagOrOptions], - {1,2,-1,3,4}). + {1,2,-1,3,4} + ). -spec crypto_one_time(Cipher, Key, IV, Data, FlagOrOptions) -> @@ -912,11 +903,9 @@ crypto_one_time(Cipher, Key, Data, FlagOrOptions) -> Result :: binary() . crypto_one_time(Cipher, Key, IV, Data, FlagOrOptions) -> - ?nif_call(ng_crypto_one_time_nif(alias(Cipher,Key), - Key, - IV, - Data, - FlagOrOptions)). + ?nif_call(ng_crypto_one_time_nif(alias(Cipher,Key), Key, IV, Data, FlagOrOptions), + [Cipher, Key, IV, Data, FlagOrOptions], + {}). %%%---------------------------------------------------------------- -spec crypto_one_time_aead(Cipher, Key, IV, InText, AAD, EncFlag::true) -> @@ -932,9 +921,9 @@ crypto_one_time(Cipher, Key, IV, Data, FlagOrOptions) -> OutTag :: binary(). crypto_one_time_aead(Cipher, Key, IV, PlainText, AAD, true) -> - ?nif_call(aead_cipher_nif(alias(Cipher,Key), Key, IV, - PlainText, AAD, aead_tag_len(Cipher), true), - {1,2,3,4,5,-1,6}). + ?nif_call(aead_cipher_nif(alias(Cipher,Key), Key, IV, PlainText, AAD, aead_tag_len(Cipher), true), + {1,2,3,4,5,-1,6} + ). -spec crypto_one_time_aead(Cipher, Key, IV, InText, AAD, TagOrTagLength, EncFlag) -> @@ -956,10 +945,10 @@ crypto_one_time_aead(Cipher, Key, IV, PlainText, AAD, true) -> OutPlainText :: binary(). crypto_one_time_aead(Cipher, Key, IV, TextIn, AAD, TagOrTagLength, EncFlg) -> - ?nif_call(aead_cipher_nif(alias(Cipher,Key), Key, IV, - TextIn, AAD, TagOrTagLength, EncFlg), + ?nif_call(aead_cipher_nif(alias(Cipher,Key), Key, IV, TextIn, AAD, TagOrTagLength, EncFlg), [Cipher, Key, IV, TextIn, AAD, TagOrTagLength, EncFlg], - {}). + {} + ). aead_tag_len(aes_ccm ) -> 12; |