Move previous cryptopals work into an Erlang subfolder, start cryptopals in Python 3
[sandbox] / cryptopals-erlang / 01.02 / hex_tests.erl
diff --git a/cryptopals-erlang/01.02/hex_tests.erl b/cryptopals-erlang/01.02/hex_tests.erl
new file mode 100644 (file)
index 0000000..2e41af0
--- /dev/null
@@ -0,0 +1,16 @@
+-module(hex_tests).
+-include_lib("eunit/include/eunit.hrl").
+
+decode_test() -> ?assertEqual(
+    [1,35,69,103,137,171,205,239],
+    hex:decode("0123456789abcdef")).
+
+encode_test() -> ?assertEqual(
+    "0123456789abcdef",
+    hex:encode([1,35,69,103,137,171,205,239])).
+
+fixed_xor_test() -> ?assertEqual(
+    "746865206b696420646f6e277420706c6179",
+    hex:fixed_xor(
+        "1c0111001f010100061a024b53535009181c",
+        "686974207468652062756c6c277320657965")).