summaryrefslogtreecommitdiff
path: root/lib/crypto/test/crypto_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/crypto/test/crypto_SUITE.erl')
-rw-r--r--lib/crypto/test/crypto_SUITE.erl41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 4c89cdafe9..40b6ad46d6 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -57,6 +57,8 @@
bad_verify_name/1,
cipher_info/0,
cipher_info/1,
+ cipher_info_prop_aead_attr/0,
+ cipher_info_prop_aead_attr/1,
cipher_padding/1,
compute/0,
compute/1,
@@ -1242,6 +1244,45 @@ cipher_info(Config) when is_list(Config) ->
ct:fail('Cipher unsupported',[])
end.
+cipher_info_prop_aead_attr() ->
+ [{doc, "crypto cipher_info prop_aead attribute testing"}].
+cipher_info_prop_aead_attr(Config) when is_list(Config) ->
+ AeadCiphers = [aes_128_ccm, aes_192_ccm, aes_256_ccm, aes_128_gcm, aes_192_gcm, aes_256_gcm, chacha20_poly1305],
+ case lists:foldl(fun(C,Ok) ->
+ case crypto:cipher_info(C) of
+ #{prop_aead := true} ->
+ true and Ok;
+ _ ->
+ false
+ end
+ end,
+ true,
+ AeadCiphers
+ )
+ of
+ true ->
+ ok;
+ false ->
+ ct:fail('AEAD Cipher attribute reported false',[])
+ end,
+ NonAeadCiphers = [aes_ige256, blowfish_cbc, blowfish_cfb64],
+ case lists:foldl(fun(C,Ok) ->
+ case crypto:cipher_info(C) of
+ #{prop_aead := false} ->
+ true and Ok;
+ _ ->
+ false
+ end
+ end,
+ true,
+ NonAeadCiphers
+ )
+ of
+ true ->
+ ok;
+ false ->
+ ct:fail('Non-AEAD Cipher attribute reported true',[])
+ end.
%%--------------------------------------------------------------------
hash_info() ->