aboutsummaryrefslogtreecommitdiffstats
path: root/lib/crypto/src
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2019-03-22 10:03:49 +0100
committerGitHub <[email protected]>2019-03-22 10:03:49 +0100
commit1b6895221c98b6be55088790c5fb3057f1c9b304 (patch)
tree08c38d08f223a3fd737c835e242995475159c183 /lib/crypto/src
parentd096ca2c0cebec816fa2e0386b7e5f0d8cd62a88 (diff)
parente7c0b56a28a85959fbde9de88b982cae94bf3474 (diff)
downloadotp-1b6895221c98b6be55088790c5fb3057f1c9b304.tar.gz
otp-1b6895221c98b6be55088790c5fb3057f1c9b304.tar.bz2
otp-1b6895221c98b6be55088790c5fb3057f1c9b304.zip
Merge pull request #2186 from essen/improve-cipher-info
Make crypto:cipher_info work for all ciphers and aliases OTP-15655
Diffstat (limited to 'lib/crypto/src')
-rw-r--r--lib/crypto/src/crypto.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index 5cf34f8069..503c347c56 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -550,8 +550,20 @@ poly1305(Key, Data) ->
-spec cipher_info(Type) -> map() when Type :: block_cipher_with_iv()
| aead_cipher()
| block_cipher_without_iv().
+%% These ciphers are not available via the EVP interface on older cryptolibs.
+cipher_info(aes_ctr) ->
+ #{block_size => 1,iv_length => 16,key_length => 32,mode => ctr_mode,type => undefined};
+cipher_info(aes_128_ctr) ->
+ #{block_size => 1,iv_length => 16,key_length => 16,mode => ctr_mode,type => undefined};
+cipher_info(aes_192_ctr) ->
+ #{block_size => 1,iv_length => 16,key_length => 24,mode => ctr_mode,type => undefined};
+cipher_info(aes_256_ctr) ->
+ #{block_size => 1,iv_length => 16,key_length => 32,mode => ctr_mode,type => undefined};
+%% This cipher is handled specialy.
+cipher_info(aes_ige256) ->
+ #{block_size => 16,iv_length => 32,key_length => 16,mode => ige_mode,type => undefined};
cipher_info(Type) ->
- cipher_info_nif(Type).
+ cipher_info_nif(alias(Type)).
%%%---- Block ciphers
%%%----------------------------------------------------------------