2007-10-07 00:01:26 -04:00
|
|
|
USING: crypto.common kernel math sequences ;
|
|
|
|
IN: crypto.xor
|
|
|
|
|
2008-04-03 14:57:33 -04:00
|
|
|
ERROR: no-xor-key ;
|
2007-10-07 00:01:26 -04:00
|
|
|
|
2008-04-03 14:57:33 -04:00
|
|
|
: xor-crypt ( key seq -- seq' )
|
|
|
|
over empty? [ no-xor-key ] when
|
2007-10-07 00:01:26 -04:00
|
|
|
dup length rot [ mod-nth bitxor ] curry 2map ;
|