1 USING: continuations crypto.xor kernel strings tools.test ;
5 [ "" dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
6 [ { } dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
7 [ V{ } dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
8 [ "" "asdf" dupd xor-crypt xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
11 [ "\0\0\0\0\0\0\0" ] [ "abcdefg" dup xor-crypt ] unit-test
13 [ { 15 15 15 15 } ] [ { 10 10 10 10 } { 5 5 5 5 } xor-crypt ] unit-test
15 [ "asdf" ] [ "asdf" "key" [ xor-crypt ] [ xor-crypt ] bi >string ] unit-test
16 [ "" ] [ "" "key" xor-crypt >string ] unit-test
17 [ "a longer message...!" ] [
18 "a longer message...!"
19 "." [ xor-crypt ] [ xor-crypt ] bi >string
21 [ "a longer message...!" ] [
22 "a longer message...!"
23 "a very long key, longer than the message even."
24 [ xor-crypt ] [ xor-crypt ] bi >string