From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/tests/arc4.pm | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 pintos-progos/tests/arc4.pm (limited to 'pintos-progos/tests/arc4.pm') diff --git a/pintos-progos/tests/arc4.pm b/pintos-progos/tests/arc4.pm deleted file mode 100644 index df19216..0000000 --- a/pintos-progos/tests/arc4.pm +++ /dev/null @@ -1,29 +0,0 @@ -use strict; -use warnings; - -sub arc4_init { - my ($key) = @_; - my (@s) = 0...255; - my ($j) = 0; - for my $i (0...255) { - $j = ($j + $s[$i] + ord (substr ($key, $i % length ($key), 1))) & 0xff; - @s[$i, $j] = @s[$j, $i]; - } - return (0, 0, @s); -} - -sub arc4_crypt { - my ($arc4, $buf) = @_; - my ($i, $j, @s) = @$arc4; - my ($out) = ""; - for my $c (split (//, $buf)) { - $i = ($i + 1) & 0xff; - $j = ($j + $s[$i]) & 0xff; - @s[$i, $j] = @s[$j, $i]; - $out .= chr (ord ($c) ^ $s[($s[$i] + $s[$j]) & 0xff]); - } - @$arc4 = ($i, $j, @s); - return $out; -} - -1; -- cgit v1.2.3