10 lines
211 B
Factor
10 lines
211 B
Factor
|
USING: errors kernel math sequences ;
|
||
|
IN: crypto
|
||
|
|
||
|
TUPLE: no-xor-key ;
|
||
|
|
||
|
: xor-crypt ( key seq -- seq )
|
||
|
over empty? [ <no-xor-key> throw ] when
|
||
|
[ length ] keep
|
||
|
[ >r over mod-nth r> bitxor ] 2map nip ;
|