# -*-perl-*- # # $Id$ # # Create tables of algorithms # # (c) 2001 Straylight/Edgeware # #----- Licensing notice ----------------------------------------------------- # # This file is part of the Perl interface to Catacomb. # # Catacomb/Perl is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # Catacomb/Perl is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Catacomb/Perl; if not, write to the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @cipher = qw(des desx des3 blowfish twofish cast128 cast256 idea safer safersk rc2 rc5 square rijndael rijndael192 rijndael256 serpent noekeon skipjack mars tea xtea); @stream = qw(rc4 seal); @hash = qw(md5 md4 md2 tiger has160 sha sha224 sha256 sha384 sha512 rmd128 rmd160 rmd256 rmd320 whirlpool whirlpool256); sub enum { $x = shift; if (!ref($x)) { return $x; } elsif (ref($x) eq ARRAY) { return @$x } else { die "bad ref"; } } sub cross { my $x = []; foreach my $i (@_) { my @y = enum($i); if (@$x) { my @x = (); foreach my $j (@$x) { foreach my $k (@y) { push(@x, $j.$k); } } $x = \@x; } else { $x = \@y; } } return @$x; } open OUT, "> $ARGV[0]" or die "couldn't write `$ARGV[0]': $!"; print OUT <\n"), "\n"; print OUT cross("#include \n"), "\n"; print OUT cross("#include \n"), "\n"; print OUT <