From c7d371256a1f6f0a60d62f70d1bca2a45867e22e Mon Sep 17 00:00:00 2001 From: andreaP Date: Mon, 15 Dec 2014 14:43:44 +0100 Subject: add aes ecb to crypto library --- lib/crypto/c_src/crypto.c | 34 ++++++++++++++++++++++++++++++++++ lib/crypto/src/crypto.erl | 20 ++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c index 750f3db7ef..f9317d7a00 100644 --- a/lib/crypto/c_src/crypto.c +++ b/lib/crypto/c_src/crypto.c @@ -242,6 +242,7 @@ static ERL_NIF_TERM aes_cfb_8_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM static ERL_NIF_TERM aes_cfb_128_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); static ERL_NIF_TERM aes_ctr_encrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); static ERL_NIF_TERM aes_ctr_stream_encrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); +static ERL_NIF_TERM aes_ecb_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); static ERL_NIF_TERM rand_bytes_1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); static ERL_NIF_TERM strong_rand_bytes_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); static ERL_NIF_TERM rand_bytes_3(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]); @@ -379,6 +380,7 @@ static ErlNifFunc nif_funcs[] = { {"aes_ctr_decrypt", 3, aes_ctr_encrypt}, {"aes_ctr_stream_encrypt", 2, aes_ctr_stream_encrypt}, {"aes_ctr_stream_decrypt", 2, aes_ctr_stream_encrypt}, + {"aes_ecb_crypt", 3, aes_ecb_crypt}, {"rand_bytes", 1, rand_bytes_1}, {"strong_rand_bytes_nif", 1, strong_rand_bytes_nif}, {"rand_bytes", 3, rand_bytes_3}, @@ -2032,6 +2034,38 @@ static ERL_NIF_TERM chacha20_poly1305_decrypt(ErlNifEnv* env, int argc, const ER #endif } +static ERL_NIF_TERM aes_ecb_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) +{/* (Key, Data, IsEncrypt) */ + ErlNifBinary key_bin, data_bin; + AES_KEY aes_key; + int i; + unsigned char* ret_ptr; + ERL_NIF_TERM ret; + + CHECK_OSE_CRYPTO(); + + if (!enif_inspect_iolist_as_binary(env, argv[0], &key_bin) + || (key_bin.size != 16 && key_bin.size != 32) + || !enif_inspect_iolist_as_binary(env, argv[1], &data_bin) + || data_bin.size % 16 != 0) { + return enif_make_badarg(env); + } + + if (argv[2] == atom_true) { + i = AES_ENCRYPT; + AES_set_encrypt_key(key_bin.data, key_bin.size*8, &aes_key); + } + else { + i = AES_DECRYPT; + AES_set_decrypt_key(key_bin.data, key_bin.size*8, &aes_key); + } + + ret_ptr = enif_make_new_binary(env, data_bin.size, &ret); + AES_ecb_encrypt(data_bin.data, ret_ptr, &aes_key, i); + CONSUME_REDS(env,data_bin); + return ret; +} + static ERL_NIF_TERM rand_bytes_1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) {/* (Bytes) */ unsigned bytes; diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index 7f82fa83fd..ed8953fa62 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -154,6 +154,10 @@ -deprecated({aes_ctr_decrypt, 3, next_major_release}). -deprecated({rc4_encrypt, 2, next_major_release}). +%aes enc/dec +-export([aes_ecb_crypt/3,aes_ecb_encrypt/2,aes_ecb_decrypt/2]). +-deprecated({aes_ecb_crypt, 3}). + %% Replace by public/private_encrypt/decrypt -export([rsa_public_encrypt/3, rsa_private_decrypt/3]). -export([rsa_private_encrypt/3, rsa_public_decrypt/3]). @@ -1392,6 +1396,21 @@ do_stream_decrypt({rc4, State0}, Data) -> aes_ctr_encrypt(_Key, _IVec, _Data) -> ?nif_stub. aes_ctr_decrypt(_Key, _IVec, _Cipher) -> ?nif_stub. +%% +%% AES - in electronic codebook mode (ECB) +%% +-spec aes_ecb_crypt(iodata(), iodata(), integer()) -> + binary(). + +aes_ecb_encrypt(Key, Data) -> + aes_ecb_crypt(Key, Data, true). + +aes_ecb_decrypt(Key, Data) -> + aes_ecb_crypt(Key, Data, false). + +aes_ecb_crypt(_Key, __Data, _IsEncrypt) -> ?nif_stub. + + %% %% AES - in counter mode (CTR) with state maintained for multi-call streaming %% @@ -1850,6 +1869,7 @@ mod_exp_nif(_Base,_Exp,_Mod,_bin_hdr) -> ?nif_stub. aes_ctr_encrypt, aes_ctr_decrypt, aes_ctr_stream_init, aes_ctr_stream_encrypt, aes_ctr_stream_decrypt, %% + aes_ecb_encrypt, aes_decrypt, next_iv, %% deprecated aes_cbc_ivec, -- cgit v1.2.3 From bd65ff0b39f3bfb23cef865dd03044a99d97d2fd Mon Sep 17 00:00:00 2001 From: andreaP Date: Tue, 23 Dec 2014 15:25:59 +0100 Subject: fixes and tests --- lib/crypto/src/crypto.erl | 20 +++++--- lib/crypto/test/crypto_SUITE.erl | 102 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 7 deletions(-) diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index ed8953fa62..c59c9077c2 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -154,9 +154,10 @@ -deprecated({aes_ctr_decrypt, 3, next_major_release}). -deprecated({rc4_encrypt, 2, next_major_release}). -%aes enc/dec --export([aes_ecb_crypt/3,aes_ecb_encrypt/2,aes_ecb_decrypt/2]). --deprecated({aes_ecb_crypt, 3}). +%aes ecb enc/dec +-export([aes_ecb_encrypt/2,aes_ecb_decrypt/2]). +-deprecated({aes_ecb_encrypt, 2, next_major_release}). +-deprecated({aes_ecb_decrypt, 2, next_major_release}). %% Replace by public/private_encrypt/decrypt -export([rsa_public_encrypt/3, rsa_private_decrypt/3]). @@ -372,19 +373,24 @@ block_decrypt(chacha20_poly1305, Key, Ivec, {AAD, Data, Tag}) -> end; block_decrypt(rc2_cbc, Key, Ivec, Data) -> rc2_cbc_decrypt(Key, Ivec, Data). --spec block_encrypt(des_ecb | blowfish_ecb, Key::iodata(), Data::iodata()) -> binary(). + +-spec block_encrypt(des_ecb | blowfish_ecb | aes_ecb, Key::iodata(), Data::iodata()) -> binary(). block_encrypt(des_ecb, Key, Data) -> des_ecb_encrypt(Key, Data); block_encrypt(blowfish_ecb, Key, Data) -> - blowfish_ecb_encrypt(Key, Data). + blowfish_ecb_encrypt(Key, Data); +block_encrypt(aes_ecb, Key, Data) -> + aes_ecb_encrypt(Key, Data). -spec block_decrypt(des_ecb | blowfish_ecb, Key::iodata(), Data::iodata()) -> binary(). block_decrypt(des_ecb, Key, Data) -> des_ecb_decrypt(Key, Data); block_decrypt(blowfish_ecb, Key, Data) -> - blowfish_ecb_decrypt(Key, Data). + blowfish_ecb_decrypt(Key, Data); +block_decrypt(aes_ecb, Key, Data) -> + aes_ecb_decrypt(Key, Data). -spec next_iv(des_cbc | des3_cbc | aes_cbc | aes_ige, Data::iodata()) -> binary(). @@ -1869,7 +1875,7 @@ mod_exp_nif(_Base,_Exp,_Mod,_bin_hdr) -> ?nif_stub. aes_ctr_encrypt, aes_ctr_decrypt, aes_ctr_stream_init, aes_ctr_stream_encrypt, aes_ctr_stream_decrypt, %% - aes_ecb_encrypt, aes_decrypt, + aes_ecb_encrypt, aes_ecb_decrypt, next_iv, %% deprecated aes_cbc_ivec, diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 1031e6403f..1206ba2ca2 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -58,6 +58,7 @@ all() -> {group, aes_cfb8}, {group, aes_cfb128}, {group, aes_cbc256}, + {group, aes_ecb}, {group, aes_ige256}, {group, rc2_cbc}, {group, rc4}, @@ -96,6 +97,7 @@ groups() -> {aes_cfb8,[], [block]}, {aes_cfb128,[], [block]}, {aes_cbc256,[], [block]}, + {aes_ecb,[], [block]}, {aes_ige256,[], [block]}, {blowfish_cbc, [], [block]}, {blowfish_ecb, [], [block]}, @@ -749,6 +751,9 @@ group_config(aes_cbc128, Config) -> group_config(aes_cbc256, Config) -> Block = aes_cbc256(), [{block, Block} | Config]; +group_config(aes_ecb, Config) -> + Block = aes_ecb(), + [{block, Block} | Config]; group_config(aes_ige256, Config) -> Block = aes_ige256(), [{block, Block} | Config]; @@ -1183,6 +1188,103 @@ aes_cbc256() -> hexstr2bin("f69f2445df4f9b17ad2b417be66c3710")} ]. +aes_ecb() -> + [ + {aes_ecb, + hexstr2bin("0000000000000000"), + hexstr2bin("0000000000000000")}, + {aes_ecb, + hexstr2bin("FFFFFFFFFFFFFFFF"), + hexstr2bin("FFFFFFFFFFFFFFFF")}, + {aes_ecb, + hexstr2bin("3000000000000000"), + hexstr2bin("1000000000000001")}, + {aes_ecb, + hexstr2bin("1111111111111111"), + hexstr2bin("1111111111111111")}, + {aes_ecb, + hexstr2bin("0123456789ABCDEF"), + hexstr2bin("1111111111111111")}, + {aes_ecb, + hexstr2bin("0000000000000000"), + hexstr2bin("0000000000000000")}, + {aes_ecb, + hexstr2bin("FEDCBA9876543210"), + hexstr2bin("0123456789ABCDEF")}, + {aes_ecb, + hexstr2bin("7CA110454A1A6E57"), + hexstr2bin("01A1D6D039776742")}, + {aes_ecb, + hexstr2bin("0131D9619DC1376E"), + hexstr2bin("5CD54CA83DEF57DA")}, + {aes_ecb, + hexstr2bin("07A1133E4A0B2686"), + hexstr2bin("0248D43806F67172")}, + {aes_ecb, + hexstr2bin("3849674C2602319E"), + hexstr2bin("51454B582DDF440A")}, + {aes_ecb, + hexstr2bin("04B915BA43FEB5B6"), + hexstr2bin("42FD443059577FA2")}, + {aes_ecb, + hexstr2bin("0113B970FD34F2CE"), + hexstr2bin("059B5E0851CF143A")}, + {aes_ecb, + hexstr2bin("0170F175468FB5E6"), + hexstr2bin("0756D8E0774761D2")}, + {aes_ecb, + hexstr2bin("43297FAD38E373FE"), + hexstr2bin("762514B829BF486A")}, + {aes_ecb, + hexstr2bin("07A7137045DA2A16"), + hexstr2bin("3BDD119049372802")}, + {aes_ecb, + hexstr2bin("04689104C2FD3B2F"), + hexstr2bin("26955F6835AF609A")}, + {aes_ecb, + hexstr2bin("37D06BB516CB7546"), + hexstr2bin("164D5E404F275232")}, + {aes_ecb, + hexstr2bin("1F08260D1AC2465E"), + hexstr2bin("6B056E18759F5CCA")}, + {aes_ecb, + hexstr2bin("584023641ABA6176"), + hexstr2bin("004BD6EF09176062")}, + {aes_ecb, + hexstr2bin("025816164629B007"), + hexstr2bin("480D39006EE762F2")}, + {aes_ecb, + hexstr2bin("49793EBC79B3258F"), + hexstr2bin("437540C8698F3CFA")}, + {aes_ecb, + hexstr2bin("018310DC409B26D6"), + hexstr2bin("1D9D5C5018F728C2")}, + {aes_ecb, + hexstr2bin("1C587F1C13924FEF"), + hexstr2bin("305532286D6F295A")}, + {aes_ecb, + hexstr2bin("0101010101010101"), + hexstr2bin("0123456789ABCDEF")}, + {aes_ecb, + hexstr2bin("1F1F1F1F0E0E0E0E"), + hexstr2bin("0123456789ABCDEF")}, + {aes_ecb, + hexstr2bin("E0FEE0FEF1FEF1FE"), + hexstr2bin("0123456789ABCDEF")}, + {aes_ecb, + hexstr2bin("0000000000000000"), + hexstr2bin("FFFFFFFFFFFFFFFF")}, + {aes_ecb, + hexstr2bin("FFFFFFFFFFFFFFFF"), + hexstr2bin("0000000000000000")}, + {aes_ecb, + hexstr2bin("0123456789ABCDEF"), + hexstr2bin("0000000000000000")}, + {aes_ecb, + hexstr2bin("FEDCBA9876543210"), + hexstr2bin("FFFFFFFFFFFFFFFF")} + ]. + aes_ige256() -> [{aes_ige256, hexstr2bin("603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4"), -- cgit v1.2.3 From 8f45c2409ca2f28f716f01d09047c6bb6f90d9b9 Mon Sep 17 00:00:00 2001 From: andreaP Date: Tue, 23 Dec 2014 15:38:51 +0100 Subject: proposal of documentation --- lib/crypto/doc/src/crypto.xml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 271130a9e6..77cff252ef 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -169,7 +169,38 @@ + + block_encrypt(Type, Key, PlainText) -> CipherText + Encrypt PlainTextaccording to Type block cipher + + Type = des_ecb | blowfish_ecb | aes_ecb + Key = block_key() + PlainText = iodata() + + +

Encrypt PlainTextaccording to Type block cipher. +

May throw exception notsup in case the chosen Type + is not supported by the underlying OpenSSL implementation.

+
+
+ + block_decrypt(Type, Key, CipherText) -> PlainText + Decrypt CipherTextaccording to Type block cipher + + Type = des_ecb | blowfish_ecb | aes_ecb + Key = block_key() + PlainText = iodata() + + +

Decrypt CipherTextaccording to Type block cipher. +

May throw exception notsup in case the chosen Type + is not supported by the underlying OpenSSL implementation.

+
+
+ + + block_encrypt(Type, Key, Ivec, PlainText) -> CipherText block_encrypt(AeadType, Key, Ivec, {AAD, PlainText}) -> {CipherText, CipherTag} Encrypt PlainText according to Type block cipher -- cgit v1.2.3 From 395800d7d8bc0370cab4a69a81011da93f96af55 Mon Sep 17 00:00:00 2001 From: andreaP Date: Wed, 24 Dec 2014 09:51:21 +0100 Subject: fixed incorrect tag --- lib/crypto/doc/src/crypto.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 77cff252ef..092bb84cd9 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -199,7 +199,6 @@ - block_encrypt(Type, Key, Ivec, PlainText) -> CipherText block_encrypt(AeadType, Key, Ivec, {AAD, PlainText}) -> {CipherText, CipherTag} -- cgit v1.2.3 From 8ccf6b58c81a7b43b8f98584ed77e2d20dbce0bf Mon Sep 17 00:00:00 2001 From: andreaP Date: Wed, 7 Jan 2015 10:13:09 +0100 Subject: finally fixed docs --- lib/crypto/doc/src/crypto.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index 092bb84cd9..eff6129622 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -169,7 +169,7 @@ - + block_encrypt(Type, Key, PlainText) -> CipherText Encrypt PlainTextaccording to Type block cipher @@ -178,7 +178,7 @@ PlainText = iodata() -

Encrypt PlainTextaccording to Type block cipher. +

Encrypt PlainTextaccording to Type block cipher.

May throw exception notsup in case the chosen Type is not supported by the underlying OpenSSL implementation.

@@ -193,13 +193,13 @@ PlainText = iodata() -

Decrypt CipherTextaccording to Type block cipher. +

Decrypt CipherTextaccording to Type block cipher.

May throw exception notsup in case the chosen Type is not supported by the underlying OpenSSL implementation.

- + block_encrypt(Type, Key, Ivec, PlainText) -> CipherText block_encrypt(AeadType, Key, Ivec, {AAD, PlainText}) -> {CipherText, CipherTag} Encrypt PlainText according to Type block cipher -- cgit v1.2.3 From 6dbb25ea9c95b5101975e8ce60db65c219449266 Mon Sep 17 00:00:00 2001 From: andreaP Date: Thu, 8 Jan 2015 18:04:57 +0100 Subject: aligned implementation following last specs --- lib/crypto/doc/src/crypto.xml | 12 ++-- lib/crypto/src/crypto.erl | 10 +-- lib/crypto/test/crypto_SUITE.erl | 127 ++++++++++++++++++++------------------- 3 files changed, 73 insertions(+), 76 deletions(-) diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml index eff6129622..34de65217b 100644 --- a/lib/crypto/doc/src/crypto.xml +++ b/lib/crypto/doc/src/crypto.xml @@ -171,14 +171,14 @@ block_encrypt(Type, Key, PlainText) -> CipherText - Encrypt PlainTextaccording to Type block cipher + Encrypt PlainText according to Type block cipher Type = des_ecb | blowfish_ecb | aes_ecb Key = block_key() PlainText = iodata() -

Encrypt PlainTextaccording to Type block cipher.

+

Encrypt PlainText according to Type block cipher.

May throw exception notsup in case the chosen Type is not supported by the underlying OpenSSL implementation.

@@ -186,14 +186,14 @@ block_decrypt(Type, Key, CipherText) -> PlainText - Decrypt CipherTextaccording to Type block cipher + Decrypt CipherText according to Type block cipher Type = des_ecb | blowfish_ecb | aes_ecb Key = block_key() PlainText = iodata() -

Decrypt CipherTextaccording to Type block cipher.

+

Decrypt CipherText according to Type block cipher.

May throw exception notsup in case the chosen Type is not supported by the underlying OpenSSL implementation.

@@ -211,7 +211,7 @@ AAD = IVec = CipherText = CipherTag = binary() -

Encrypt PlainTextaccording to Type block cipher. +

Encrypt PlainText according to Type block cipher. IVec is an arbitrary initializing vector.

In AEAD (Authenticated Encryption with Associated Data) mode, encrypt PlainTextaccording to Type block cipher and calculate @@ -233,7 +233,7 @@ AAD = IVec = CipherText = CipherTag = binary() -

Decrypt CipherTextaccording to Type block cipher. +

Decrypt CipherText according to Type block cipher. IVec is an arbitrary initializing vector.

In AEAD (Authenticated Encryption with Associated Data) mode, decrypt CipherTextaccording to Type block cipher and check the authenticity diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl index c59c9077c2..695c33f586 100644 --- a/lib/crypto/src/crypto.erl +++ b/lib/crypto/src/crypto.erl @@ -154,11 +154,6 @@ -deprecated({aes_ctr_decrypt, 3, next_major_release}). -deprecated({rc4_encrypt, 2, next_major_release}). -%aes ecb enc/dec --export([aes_ecb_encrypt/2,aes_ecb_decrypt/2]). --deprecated({aes_ecb_encrypt, 2, next_major_release}). --deprecated({aes_ecb_decrypt, 2, next_major_release}). - %% Replace by public/private_encrypt/decrypt -export([rsa_public_encrypt/3, rsa_private_decrypt/3]). -export([rsa_private_encrypt/3, rsa_public_decrypt/3]). @@ -216,7 +211,7 @@ supports()-> [{hashs, Hashs}, {ciphers, [des_cbc, des_cfb, des3_cbc, des_ede3, blowfish_cbc, blowfish_cfb64, blowfish_ofb64, blowfish_ecb, aes_cbc128, aes_cfb8, aes_cfb128, - aes_cbc256, rc2_cbc, aes_ctr, rc4] ++ Ciphers}, + aes_cbc256, rc2_cbc, aes_ctr, rc4, aes_ecb] ++ Ciphers}, {public_keys, [rsa, dss, dh, srp] ++ PubKeys} ]. @@ -383,7 +378,7 @@ block_encrypt(blowfish_ecb, Key, Data) -> block_encrypt(aes_ecb, Key, Data) -> aes_ecb_encrypt(Key, Data). --spec block_decrypt(des_ecb | blowfish_ecb, Key::iodata(), Data::iodata()) -> binary(). +-spec block_decrypt(des_ecb | blowfish_ecb | aes_ecb, Key::iodata(), Data::iodata()) -> binary(). block_decrypt(des_ecb, Key, Data) -> des_ecb_decrypt(Key, Data); @@ -1875,7 +1870,6 @@ mod_exp_nif(_Base,_Exp,_Mod,_bin_hdr) -> ?nif_stub. aes_ctr_encrypt, aes_ctr_decrypt, aes_ctr_stream_init, aes_ctr_stream_encrypt, aes_ctr_stream_decrypt, %% - aes_ecb_encrypt, aes_ecb_decrypt, next_iv, %% deprecated aes_cbc_ivec, diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl index 1206ba2ca2..e3ff753f71 100644 --- a/lib/crypto/test/crypto_SUITE.erl +++ b/lib/crypto/test/crypto_SUITE.erl @@ -1191,98 +1191,101 @@ aes_cbc256() -> aes_ecb() -> [ {aes_ecb, - hexstr2bin("0000000000000000"), - hexstr2bin("0000000000000000")}, + <<"YELLOW SUBMARINE">>, + <<"YELLOW SUBMARINE">>}, {aes_ecb, - hexstr2bin("FFFFFFFFFFFFFFFF"), - hexstr2bin("FFFFFFFFFFFFFFFF")}, + <<"0000000000000000">>, + <<"0000000000000000">>}, {aes_ecb, - hexstr2bin("3000000000000000"), - hexstr2bin("1000000000000001")}, + <<"FFFFFFFFFFFFFFFF">>, + <<"FFFFFFFFFFFFFFFF">>}, {aes_ecb, - hexstr2bin("1111111111111111"), - hexstr2bin("1111111111111111")}, + <<"3000000000000000">>, + <<"1000000000000001">>}, {aes_ecb, - hexstr2bin("0123456789ABCDEF"), - hexstr2bin("1111111111111111")}, + <<"1111111111111111">>, + <<"1111111111111111">>}, {aes_ecb, - hexstr2bin("0000000000000000"), - hexstr2bin("0000000000000000")}, + <<"0123456789ABCDEF">>, + <<"1111111111111111">>}, {aes_ecb, - hexstr2bin("FEDCBA9876543210"), - hexstr2bin("0123456789ABCDEF")}, + <<"0000000000000000">>, + <<"0000000000000000">>}, {aes_ecb, - hexstr2bin("7CA110454A1A6E57"), - hexstr2bin("01A1D6D039776742")}, + <<"FEDCBA9876543210">>, + <<"0123456789ABCDEF">>}, {aes_ecb, - hexstr2bin("0131D9619DC1376E"), - hexstr2bin("5CD54CA83DEF57DA")}, + <<"7CA110454A1A6E57">>, + <<"01A1D6D039776742">>}, {aes_ecb, - hexstr2bin("07A1133E4A0B2686"), - hexstr2bin("0248D43806F67172")}, + <<"0131D9619DC1376E">>, + <<"5CD54CA83DEF57DA">>}, {aes_ecb, - hexstr2bin("3849674C2602319E"), - hexstr2bin("51454B582DDF440A")}, + <<"07A1133E4A0B2686">>, + <<"0248D43806F67172">>}, {aes_ecb, - hexstr2bin("04B915BA43FEB5B6"), - hexstr2bin("42FD443059577FA2")}, + <<"3849674C2602319E">>, + <<"51454B582DDF440A">>}, {aes_ecb, - hexstr2bin("0113B970FD34F2CE"), - hexstr2bin("059B5E0851CF143A")}, + <<"04B915BA43FEB5B6">>, + <<"42FD443059577FA2">>}, {aes_ecb, - hexstr2bin("0170F175468FB5E6"), - hexstr2bin("0756D8E0774761D2")}, + <<"0113B970FD34F2CE">>, + <<"059B5E0851CF143A">>}, {aes_ecb, - hexstr2bin("43297FAD38E373FE"), - hexstr2bin("762514B829BF486A")}, + <<"0170F175468FB5E6">>, + <<"0756D8E0774761D2">>}, {aes_ecb, - hexstr2bin("07A7137045DA2A16"), - hexstr2bin("3BDD119049372802")}, + <<"43297FAD38E373FE">>, + <<"762514B829BF486A">>}, {aes_ecb, - hexstr2bin("04689104C2FD3B2F"), - hexstr2bin("26955F6835AF609A")}, + <<"07A7137045DA2A16">>, + <<"3BDD119049372802">>}, {aes_ecb, - hexstr2bin("37D06BB516CB7546"), - hexstr2bin("164D5E404F275232")}, + <<"04689104C2FD3B2F">>, + <<"26955F6835AF609A">>}, {aes_ecb, - hexstr2bin("1F08260D1AC2465E"), - hexstr2bin("6B056E18759F5CCA")}, + <<"37D06BB516CB7546">>, + <<"164D5E404F275232">>}, {aes_ecb, - hexstr2bin("584023641ABA6176"), - hexstr2bin("004BD6EF09176062")}, + <<"1F08260D1AC2465E">>, + <<"6B056E18759F5CCA">>}, {aes_ecb, - hexstr2bin("025816164629B007"), - hexstr2bin("480D39006EE762F2")}, + <<"584023641ABA6176">>, + <<"004BD6EF09176062">>}, {aes_ecb, - hexstr2bin("49793EBC79B3258F"), - hexstr2bin("437540C8698F3CFA")}, + <<"025816164629B007">>, + <<"480D39006EE762F2">>}, {aes_ecb, - hexstr2bin("018310DC409B26D6"), - hexstr2bin("1D9D5C5018F728C2")}, + <<"49793EBC79B3258F">>, + <<"437540C8698F3CFA">>}, {aes_ecb, - hexstr2bin("1C587F1C13924FEF"), - hexstr2bin("305532286D6F295A")}, + <<"018310DC409B26D6">>, + <<"1D9D5C5018F728C2">>}, {aes_ecb, - hexstr2bin("0101010101010101"), - hexstr2bin("0123456789ABCDEF")}, + <<"1C587F1C13924FEF">>, + <<"305532286D6F295A">>}, {aes_ecb, - hexstr2bin("1F1F1F1F0E0E0E0E"), - hexstr2bin("0123456789ABCDEF")}, + <<"0101010101010101">>, + <<"0123456789ABCDEF">>}, {aes_ecb, - hexstr2bin("E0FEE0FEF1FEF1FE"), - hexstr2bin("0123456789ABCDEF")}, + <<"1F1F1F1F0E0E0E0E">>, + <<"0123456789ABCDEF">>}, {aes_ecb, - hexstr2bin("0000000000000000"), - hexstr2bin("FFFFFFFFFFFFFFFF")}, + <<"E0FEE0FEF1FEF1FE">>, + <<"0123456789ABCDEF">>}, {aes_ecb, - hexstr2bin("FFFFFFFFFFFFFFFF"), - hexstr2bin("0000000000000000")}, + <<"0000000000000000">>, + <<"FFFFFFFFFFFFFFFF">>}, {aes_ecb, - hexstr2bin("0123456789ABCDEF"), - hexstr2bin("0000000000000000")}, + <<"FFFFFFFFFFFFFFFF">>, + <<"0000000000000000">>}, {aes_ecb, - hexstr2bin("FEDCBA9876543210"), - hexstr2bin("FFFFFFFFFFFFFFFF")} + <<"0123456789ABCDEF">>, + <<"0000000000000000">>}, + {aes_ecb, + <<"FEDCBA9876543210">>, + <<"FFFFFFFFFFFFFFFF">>} ]. aes_ige256() -> -- cgit v1.2.3