--- /dev/null
+Doug Coleman
--- /dev/null
+USING: continuations crypto.xor kernel strings tools.test ;
+IN: crypto.xor.tests
+
+! No key
+[ "" dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
+[ { } dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
+[ V{ } dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
+[ "" "asdf" dupd xor-crypt xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
+
+! a xor a = 0
+{ "\0\0\0\0\0\0\0" } [ "abcdefg" dup xor-crypt ] unit-test
+
+{ { 15 15 15 15 } } [ { 10 10 10 10 } { 5 5 5 5 } xor-crypt ] unit-test
+
+{ "asdf" } [ "asdf" "key" [ xor-crypt ] [ xor-crypt ] bi >string ] unit-test
+{ "" } [ "" "key" xor-crypt >string ] unit-test
+{ "a longer message...!" } [
+ "a longer message...!"
+ "." [ xor-crypt ] [ xor-crypt ] bi >string
+] unit-test
+{ "a longer message...!" } [
+ "a longer message...!"
+ "a very long key, longer than the message even."
+ [ xor-crypt ] [ xor-crypt ] bi >string
+] unit-test
--- /dev/null
+! Copyright (C) 2008 Doug Coleman.
+! See https://factorcode.org/license.txt for BSD license.
+USING: kernel math sequences ;
+IN: crypto.xor
+
+: mod-nth ( n seq -- elt ) [ length mod ] [ nth ] bi ;
+
+ERROR: empty-xor-key ;
+
+: xor-crypt ( seq key -- seq' )
+ [ empty-xor-key ] when-empty
+ [ dup length <iota> ] dip '[ _ mod-nth bitxor ] 2map ;
+++ /dev/null
-Doug Coleman
+++ /dev/null
-USING: continuations crypto.xor kernel strings tools.test ;
-IN: crypto.xor.tests
-
-! No key
-[ "" dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
-[ { } dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
-[ V{ } dup xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
-[ "" "asdf" dupd xor-crypt xor-crypt ] [ T{ empty-xor-key } = ] must-fail-with
-
-! a xor a = 0
-{ "\0\0\0\0\0\0\0" } [ "abcdefg" dup xor-crypt ] unit-test
-
-{ { 15 15 15 15 } } [ { 10 10 10 10 } { 5 5 5 5 } xor-crypt ] unit-test
-
-{ "asdf" } [ "asdf" "key" [ xor-crypt ] [ xor-crypt ] bi >string ] unit-test
-{ "" } [ "" "key" xor-crypt >string ] unit-test
-{ "a longer message...!" } [
- "a longer message...!"
- "." [ xor-crypt ] [ xor-crypt ] bi >string
-] unit-test
-{ "a longer message...!" } [
- "a longer message...!"
- "a very long key, longer than the message even."
- [ xor-crypt ] [ xor-crypt ] bi >string
-] unit-test
+++ /dev/null
-! Copyright (C) 2008 Doug Coleman.
-! See https://factorcode.org/license.txt for BSD license.
-USING: kernel math sequences ;
-IN: crypto.xor
-
-: mod-nth ( n seq -- elt ) [ length mod ] [ nth ] bi ;
-
-ERROR: empty-xor-key ;
-
-: xor-crypt ( seq key -- seq' )
- [ empty-xor-key ] when-empty
- [ dup length <iota> ] dip '[ _ mod-nth bitxor ] 2map ;