diff options
author | Loïc Hoguin <[email protected]> | 2019-03-05 13:34:48 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-03-06 12:42:40 +0100 |
commit | 2f0aff476c585524b4eb2d8edb13c5e7357c111d (patch) | |
tree | afccd817f3334f7c55bb5835cdbbeb2c130137f4 /lib/crypto/test | |
parent | 1378b465cfa5e6eb2311bb633a0ebae1a8de3773 (diff) | |
download | otp-2f0aff476c585524b4eb2d8edb13c5e7357c111d.tar.gz otp-2f0aff476c585524b4eb2d8edb13c5e7357c111d.tar.bz2 otp-2f0aff476c585524b4eb2d8edb13c5e7357c111d.zip |
Add crypto:cipher_info/1 and crypto:hash_info/1
Also adds some more aliases that contain the key length
in their name.
Diffstat (limited to 'lib/crypto/test')
-rw-r--r-- | lib/crypto/test/crypto_SUITE.erl | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index ab6d88deb2..7257f4fb9f 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -40,7 +40,9 @@ all() -> rand_uniform, rand_threads, rand_plugin, - rand_plugin_s + rand_plugin_s, + cipher_info, + hash_info ]. groups() -> @@ -666,6 +668,23 @@ rand_plugin_s(Config) when is_list(Config) -> rand_plugin_aux(explicit_state). %%-------------------------------------------------------------------- +cipher_info() -> + [{doc, "crypto cipher_info testing"}]. +cipher_info(Config) when is_list(Config) -> + #{type := _,key_length := _,iv_length := _, + block_size := _,mode := _} = crypto:cipher_info(aes_128_cbc), + {'EXIT',_} = (catch crypto:cipher_info(not_a_cipher)), + ok. + +%%-------------------------------------------------------------------- +hash_info() -> + [{doc, "crypto hash_info testing"}]. +hash_info(Config) when is_list(Config) -> + #{type := _,size := _,block_size := _} = crypto:hash_info(sha256), + {'EXIT',_} = (catch crypto:hash_info(not_a_hash)), + ok. + +%%-------------------------------------------------------------------- %% Internal functions ------------------------------------------------ %%-------------------------------------------------------------------- hash(_, [], []) -> |