diff options
author | Sverker Eriksson <[email protected]> | 2010-11-24 18:17:33 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2010-11-24 18:17:33 +0100 |
commit | e15ad4355d1fcbc73454ebc3ce8350a2c9f05069 (patch) | |
tree | 515d8eeabe2c9e78e931e901e0d62247288a23d5 /lib/crypto/src/crypto.erl | |
parent | ba4e0b4471bfcd748499bd035b5afac058104b5f (diff) | |
parent | b9b96221a6ecb1f0fff06e842045e744bd6bd055 (diff) | |
download | otp-e15ad4355d1fcbc73454ebc3ce8350a2c9f05069.tar.gz otp-e15ad4355d1fcbc73454ebc3ce8350a2c9f05069.tar.bz2 otp-e15ad4355d1fcbc73454ebc3ce8350a2c9f05069.zip |
Merge branch 'sverker/crypto_aes_ctr_cmac/OTP-8752' into dev
* sverker/crypto_aes_ctr_cmac/OTP-8752:
Fix nif_SUITE to not assume that it is the only one loading NIFs.
crypto CTR support
Diffstat (limited to 'lib/crypto/src/crypto.erl')
-rw-r--r-- | lib/crypto/src/crypto.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index 71fd91cafd..d6e2e033c0 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -51,6 +51,7 @@ -export([aes_cbc_128_encrypt/3, aes_cbc_128_decrypt/3]). -export([aes_cbc_256_encrypt/3, aes_cbc_256_decrypt/3]). -export([aes_cbc_ivec/1]). +-export([aes_ctr_encrypt/3, aes_ctr_decrypt/3]). -export([dh_generate_parameters/2, dh_check/1]). %% Testing see below @@ -80,6 +81,7 @@ rc2_40_cbc_encrypt, rc2_40_cbc_decrypt, %% idea_cbc_encrypt, idea_cbc_decrypt, aes_cbc_256_encrypt, aes_cbc_256_decrypt, + aes_ctr_encrypt, aes_ctr_decrypt, info_lib]). -type rsa_digest_type() :: 'md5' | 'sha'. @@ -542,6 +544,16 @@ aes_cbc_ivec(Data) when is_binary(Data) -> aes_cbc_ivec(Data) when is_list(Data) -> aes_cbc_ivec(list_to_binary(Data)). +%% +%% AES - in counter mode (CTR) +%% +-spec aes_ctr_encrypt(iodata(), binary(), iodata()) -> + binary(). +-spec aes_ctr_decrypt(iodata(), binary(), iodata()) -> + binary(). + +aes_ctr_encrypt(_Key, _IVec, _Data) -> ?nif_stub. +aes_ctr_decrypt(_Key, _IVec, _Cipher) -> ?nif_stub. %% %% XOR - xor to iolists and return a binary |