r9134 - in /branches/upstream/libcrypt-rijndael-perl/current: ./ t/ t/lib/ t/rt/
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Fri Nov 9 22:54:08 UTC 2007
Author: gregoa-guest
Date: Fri Nov 9 22:54:08 2007
New Revision: 9134
URL: http://svn.debian.org/wsvn/?sc=1&rev=9134
Log:
[svn-upgrade] Integrating new upstream version, libcrypt-rijndael-perl (1.05)
Added:
branches/upstream/libcrypt-rijndael-perl/current/t/blocksize.t
branches/upstream/libcrypt-rijndael-perl/current/t/cbc.t
branches/upstream/libcrypt-rijndael-perl/current/t/cfb.t
branches/upstream/libcrypt-rijndael-perl/current/t/ctr.t
branches/upstream/libcrypt-rijndael-perl/current/t/ecb.t
branches/upstream/libcrypt-rijndael-perl/current/t/lib/
branches/upstream/libcrypt-rijndael-perl/current/t/lib/mode.pl
branches/upstream/libcrypt-rijndael-perl/current/t/ofb.t
branches/upstream/libcrypt-rijndael-perl/current/t/pcbc.t
branches/upstream/libcrypt-rijndael-perl/current/t/rt/
branches/upstream/libcrypt-rijndael-perl/current/t/rt/27632.t
Modified:
branches/upstream/libcrypt-rijndael-perl/current/Changes
branches/upstream/libcrypt-rijndael-perl/current/MANIFEST
branches/upstream/libcrypt-rijndael-perl/current/META.yml
branches/upstream/libcrypt-rijndael-perl/current/Makefile.PL
branches/upstream/libcrypt-rijndael-perl/current/README
branches/upstream/libcrypt-rijndael-perl/current/Rijndael.pm
branches/upstream/libcrypt-rijndael-perl/current/Rijndael.xs
branches/upstream/libcrypt-rijndael-perl/current/_rijndael.c
branches/upstream/libcrypt-rijndael-perl/current/rijndael.h
branches/upstream/libcrypt-rijndael-perl/current/t/test_manifest
Modified: branches/upstream/libcrypt-rijndael-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/Changes?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/Changes (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/Changes Fri Nov 9 22:54:08 2007
@@ -1,11 +1,26 @@
-0.06 - Sun Nov 12 10:38:56 2006
- * Adjust version number to match distro number (RT #4227)
- * Use <sys/types.h> instead of hard-coding (RT #22755, 9514, 18812,
- 1444, 503).
- * This module is now maintained by brian d foy (bdfoy at cpan.org)
+
+1.05 - Fri Nov 9 05:39:09 2007
+ * This version fixes the signed integer problems that Solaris had.
+ * Now this module require perl 5.6.
+ * You don't need to upgrade if your system isn't Solaris.
+
+1.04 - Mon Oct 15 14:27:00 2007
+ * Quashed warnings about overflows by casting numbers to
+ unsigned ints.
+ * This compiles warning-free and passes all tests on
+ Solaris 10 with gcc 3.4.6, so it might take care of RT
+ # 27632
+
+1.04_02 - Wed Sep 19 19:24:06 2007
+ * remove test files that shouldn't be there
+
+1.04_01 - Wed Sep 12 15:34:24 2007
+ * This developer release explores the Solaris bug noted in
+ RT # 27632. Some Solaris installations may be encrypting or
+ decrpyting incorrectly.
1.04 - Fri Feb 23 11:20:44 2007
- * Adjusted rijndael.h to use __sun to identify Solaris boxes. GCC
+ * Todd Ross adjusted rijndael.h to use __sun to identify Solaris boxes. GCC
uses __sun__ or __sun, but Solaris cc only uses __sun :
http://blogs.sun.com/morganh/date/20060928
* If you've already compiled this module, you don't need to upgrade
@@ -23,34 +38,34 @@
* This release should fix the problems with INT types on all
platforms, including 64 bit platforms.
-0.06 - Wed Jan 10 00:35:10 2007
+0.06_10 - Wed Jan 10 00:35:10 2007
* Let's try the int type for MinGW:wq
-0.06 - Fri Dec 15 08:12:02 2006
+0.06_09 - Fri Dec 15 08:12:02 2006
* Updated header file to handle Solaris special case
* I think this might be the release candidate for 0.07! :)
-0.06 - Wed Nov 29 19:51:33 2006
+0.06_08 - Wed Nov 29 19:51:33 2006
* Adjusting WIN32 targets for typedefs. Some things look like both
Unix and Windows, so I don't want compilers to choke if it tries to
redefine types.
-0.06 - Mon Nov 27 10:37:18 2006
+0.06_07 - Mon Nov 27 10:37:18 2006
* more header file fiddling to get everyone to define the right
abstract types. This time check for _SYS_TYPES_H
-0.06 - Fri Nov 17 14:56:19 2006
+0.06_06 - Fri Nov 17 14:56:19 2006
* Fooled with header file some more, and tested it myself on
Cygwin. Instead of checking for WIN32, just check for __CYGWIN__
-0.06 - Fri Nov 17 11:13:25 2006
+0.06_05 - Fri Nov 17 11:13:25 2006
* The last two revisions seem to not define UINTxx and ends up with a
parse error. Let's try this, as I go off to dig out my Windows box.
-0.06 - Wed Nov 15 14:43:37 2006
+0.06_04 - Wed Nov 15 14:43:37 2006
* Try UINT patch from David Golden to get this to work on MinGW
-0.06 - Wed Nov 15 11:07:08 2006
+0.06_03 - Wed Nov 15 11:07:08 2006
* Re-jiggered logic to define UINT32 and UINT8. First I'll try
sys/types.h, then check if they are already defined elsewhere, and
lastly hardcode the typedefs based on platform. The previous
@@ -59,6 +74,11 @@
I guard my typedefs by checking for previous definitions. Let's
hope those previous definitions are right :)
-0.06 - Sun Nov 12 16:23:07 2006
+0.06_02 - Sun Nov 12 16:23:07 2006
* Let's try some hardcoded types for UINT(32|8) for Windows.
+0.06_01 - Sun Nov 12 10:38:56 2006
+ * Adjust version number to match distro number (RT #4227)
+ * Use <sys/types.h> instead of hard-coding (RT #22755, 9514, 18812,
+ 1444, 503).
+ * This module is now maintained by brian d foy (bdfoy at cpan.org)
Modified: branches/upstream/libcrypt-rijndael-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/MANIFEST?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/MANIFEST (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/MANIFEST Fri Nov 9 22:54:08 2007
@@ -11,8 +11,17 @@
Rijndael.pm
Rijndael.xs
t/00_load.t
+t/blocksize.t
+t/cbc.t
+t/cfb.t
+t/ctr.t
+t/ecb.t
+t/lib/mode.pl
+t/ofb.t
+t/pcbc.t
t/pod.t
t/pod_coverage.t
+t/rt/27632.t
t/test_manifest
typemap
META.yml Module meta-data (added by MakeMaker)
Modified: branches/upstream/libcrypt-rijndael-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/META.yml?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/META.yml (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/META.yml Fri Nov 9 22:54:08 2007
@@ -1,14 +1,15 @@
--- #YAML:1.0
name: Crypt-Rijndael
-version: 1.04
-abstract: ~
+version: 1.05
+abstract: Crypt::CBC compliant Rijndael encryption module
license: gpl
-generated_by: ExtUtils::MakeMaker version 6.31
+generated_by: ExtUtils::MakeMaker version 6.36
distribution_type: module
requires:
+ Test::Manifest: 1.14
Test::More: 0
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
author:
- Rafael R. Sevilla (maintained by brian d foy <bdfoy at cpan.org>)
Modified: branches/upstream/libcrypt-rijndael-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/Makefile.PL?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/Makefile.PL (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/Makefile.PL Fri Nov 9 22:54:08 2007
@@ -1,17 +1,21 @@
-# $Id: Makefile.PL 2170 2007-02-22 21:31:05Z comdog $
+# $Id: Makefile.PL 2367 2007-11-09 11:38:52Z comdog $
+
+require 5.006;
use ExtUtils::MakeMaker;
eval "use Test::Manifest 1.14";
WriteMakefile(
- NAME => "Crypt::Rijndael",
- VERSION_FROM => "Rijndael.pm",
- LICENSE => 'gpl',
- AUTHOR => 'Rafael R. Sevilla (maintained by brian d foy <bdfoy at cpan.org>)',
+ 'NAME' => "Crypt::Rijndael",
+ 'VERSION_FROM' => "Rijndael.pm",
+ 'LICENSE' => 'gpl',
+ 'AUTHOR' => 'Rafael R. Sevilla (maintained by brian d foy <bdfoy at cpan.org>)',
+ 'ABSTRACT' => 'Crypt::CBC compliant Rijndael encryption module',
'PREREQ_PM' => {
'Test::More' => '0',
+ 'Test::Manifest' => '1.14',
},
@@ -28,4 +32,4 @@
},
OBJECT => q[_rijndael$(OBJ_EXT) Rijndael$(OBJ_EXT)],
-);
+ );
Modified: branches/upstream/libcrypt-rijndael-perl/current/README
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/README?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/README (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/README Fri Nov 9 22:54:08 2007
@@ -7,7 +7,7 @@
# keysize() is 32, but 24 and 16 are also possible
# blocksize() is 16
- $cipher = Crypt::Rijndael->new( "a" x 32, Crypt::Rijndael::MODE_CBC );
+ $cipher = Crypt::Rijndael->new( "a" x 32, Crypt::Rijndael::MODE_CBC() );
$cipher->set_iv($iv);
$crypted = $cipher->encrypt($plaintext);
@@ -29,7 +29,7 @@
our bytes. 128 bits, is however, the AES-specified block size, so
this is all we support.
- $cipher = new $key [, $mode]
+ $cipher = Crypt::Rijndael->new( $key [, $mode] )
Create a new "Crypt::Rijndael" cipher object with the given key
(which must be 128, 192 or 256 bits long). The additional $mode
argument is the encryption mode, either "MODE_ECB" (electronic
@@ -60,6 +60,7 @@
MODE_CTR - Counter mode
MODE_ECB - Electronic cookbook mode
MODE_OFB - Output feedback
+ MODE_PCBC - ignore this one for now :)
SEE ALSO
Crypt::CBC, http://www.csrc.nist.gov/encryption/aes/
Modified: branches/upstream/libcrypt-rijndael-perl/current/Rijndael.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/Rijndael.pm?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/Rijndael.pm (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/Rijndael.pm Fri Nov 9 22:54:08 2007
@@ -9,7 +9,7 @@
# keysize() is 32, but 24 and 16 are also possible
# blocksize() is 16
- $cipher = Crypt::Rijndael->new( "a" x 32, Crypt::Rijndael::MODE_CBC );
+ $cipher = Crypt::Rijndael->new( "a" x 32, Crypt::Rijndael::MODE_CBC() );
$cipher->set_iv($iv);
$crypted = $cipher->encrypt($plaintext);
@@ -29,9 +29,12 @@
use strict;
use vars qw( $VERSION @ISA );
+use warnings;
+no warnings;
+
require DynaLoader;
-$VERSION = '1.04';
+$VERSION = '1.05';
@ISA = qw/DynaLoader/;
bootstrap Crypt::Rijndael $VERSION;
@@ -49,7 +52,7 @@
our bytes. 128 bits, is however, the AES-specified block size,
so this is all we support.
-=item $cipher = new $key [, $mode]
+=item $cipher = Crypt::Rijndael->new( $key [, $mode] )
Create a new C<Crypt::Rijndael> cipher object with the given key
(which must be 128, 192 or 256 bits long). The additional C<$mode>
@@ -94,6 +97,8 @@
=item MODE_OFB - Output feedback
+=item MODE_PCBC - ignore this one for now :)
+
=back
=head1 SEE ALSO
Modified: branches/upstream/libcrypt-rijndael-perl/current/Rijndael.xs
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/Rijndael.xs?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/Rijndael.xs (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/Rijndael.xs Fri Nov 9 22:54:08 2007
@@ -30,13 +30,14 @@
#if (PATCHLEVEL > 4) || ((PATCHLEVEL == 4) && (SUBVERSION >= 70))
HV *stash = gv_stashpv("Crypt::Rijndael", 0);
- newCONSTSUB (stash, "keysize", newSViv (32));
- newCONSTSUB (stash, "blocksize", newSViv (16));
- newCONSTSUB (stash, "MODE_ECB", newSViv (MODE_ECB));
- newCONSTSUB (stash, "MODE_CBC", newSViv (MODE_CBC));
- newCONSTSUB (stash, "MODE_CFB", newSViv (MODE_CFB));
- newCONSTSUB (stash, "MODE_OFB", newSViv (MODE_OFB));
- newCONSTSUB (stash, "MODE_CTR", newSViv (MODE_CTR));
+ newCONSTSUB (stash, "keysize", newSViv (32) );
+ newCONSTSUB (stash, "blocksize", newSViv (16) );
+ newCONSTSUB (stash, "MODE_ECB", newSViv (MODE_ECB) );
+ newCONSTSUB (stash, "MODE_CBC", newSViv (MODE_CBC) );
+ newCONSTSUB (stash, "MODE_CFB", newSViv (MODE_CFB) );
+ newCONSTSUB (stash, "MODE_PCBC", newSViv (MODE_PCBC) );
+ newCONSTSUB (stash, "MODE_OFB", newSViv (MODE_OFB) );
+ newCONSTSUB (stash, "MODE_CTR", newSViv (MODE_CTR) );
#endif
}
@@ -74,6 +75,13 @@
MODE_CFB(...)
CODE:
RETVAL=MODE_CFB;
+ OUTPUT:
+ RETVAL
+
+int
+MODE_PCBC(...)
+ CODE:
+ RETVAL=MODE_PCBC;
OUTPUT:
RETVAL
@@ -117,7 +125,7 @@
RETVAL->ctx.mode = RETVAL->mode = mode;
/* set the IV to zero on initialization */
memset(RETVAL->iv, 0, RIJNDAEL_BLOCKSIZE);
- rijndael_setup(&RETVAL->ctx, keysize, SvPV_nolen(key));
+ rijndael_setup(&RETVAL->ctx, keysize, (UINT8 *) SvPV_nolen(key));
}
OUTPUT:
@@ -159,7 +167,7 @@
SvPOK_only (RETVAL);
SvCUR_set (RETVAL, size);
(ix ? block_decrypt : block_encrypt)
- (&self->ctx, rawbytes, size, SvPV_nolen(RETVAL), self->iv);
+ (&self->ctx, rawbytes, size, (UINT8 *) SvPV_nolen(RETVAL), self->iv);
} else
RETVAL = newSVpv ("", 0);
}
Modified: branches/upstream/libcrypt-rijndael-perl/current/_rijndael.c
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/_rijndael.c?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/_rijndael.c (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/_rijndael.c Fri Nov 9 22:54:08 2007
@@ -420,9 +420,9 @@
tables. */
for (j=0; j<4; j++) {
e = wtxt[j] & 0xff;
- e |= (wtxt[idx[1][j]]) & (0xff << 8);
- e |= (wtxt[idx[2][j]]) & (0xff << 16);
- e |= (wtxt[idx[3][j]]) & (0xff << 24);
+ e |= (wtxt[idx[1][j]]) & (0xff << 8 );
+ e |= (wtxt[idx[2][j]]) & (0xff << 16);
+ e |= (wtxt[idx[3][j]]) & (0xffU << 24);
t[j] = e;
}
for (j=0; j<4; j++)
@@ -459,9 +459,9 @@
tables. */
for (j=0; j<4; j++) {
e = wtxt[j] & 0xff;
- e |= (wtxt[iidx[1][j]]) & (0xff << 8);
- e |= (wtxt[iidx[2][j]]) & (0xff << 16);
- e |= (wtxt[iidx[3][j]]) & (0xff << 24);
+ e |= (wtxt[iidx[1][j]]) & (0xff << 8);
+ e |= (wtxt[iidx[2][j]]) & (0xff << 16);
+ e |= (wtxt[iidx[3][j]]) & (0xffU << 24);
t[j] = e;
}
for (j=0; j<4; j++)
Modified: branches/upstream/libcrypt-rijndael-perl/current/rijndael.h
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/rijndael.h?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/rijndael.h (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/rijndael.h Fri Nov 9 22:54:08 2007
@@ -35,7 +35,7 @@
#endif
/* Solaris has sys/types.h, but doesn't act like everyone else
- * GCC defines __sun__ and __sun (report from Tom Ross)
+ * GCC defines __sun__ and __sun (report from Todd Ross)
* Solaris cc defines __sun
*/
#if defined( __sun__ ) || defined( __sun )
Added: branches/upstream/libcrypt-rijndael-perl/current/t/blocksize.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/blocksize.t?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/blocksize.t (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/blocksize.t Fri Nov 9 22:54:08 2007
@@ -1,0 +1,9 @@
+#!/usr/bin/perl
+
+use Test::More 'no_plan';
+
+use_ok( 'Crypt::Rijndael' );
+
+ok( defined &Crypt::Rijndael::blocksize );
+
+is( Crypt::Rijndael->blocksize, 16 );
Added: branches/upstream/libcrypt-rijndael-perl/current/t/cbc.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/cbc.t?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/cbc.t (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/cbc.t Fri Nov 9 22:54:08 2007
@@ -1,0 +1,19 @@
+#!/usr/bin/perl
+
+use Cwd;
+use File::Spec;
+use Test::More 'no_plan';
+
+require_ok( File::Spec->catfile( cwd(), qw( t lib mode.pl ) ) );
+
+use_ok( 'Crypt::Rijndael' );
+
+ok( defined &Crypt::Rijndael::MODE_CBC );
+diag( "MODE_CBC is @{ [Crypt::Rijndael::MODE_CBC()] }" ) if $ENV{DEBUG};
+
+foreach my $a ( 0 .. 10 )
+ {
+ my $hash = crypt_decrypt( Crypt::Rijndael::MODE_CBC() );
+
+ is( $hash->{plain}, $hash->{data}, "Decrypted text matches plain text" );
+ }
Added: branches/upstream/libcrypt-rijndael-perl/current/t/cfb.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/cfb.t?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/cfb.t (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/cfb.t Fri Nov 9 22:54:08 2007
@@ -1,0 +1,19 @@
+#!/usr/bin/perl
+
+use Cwd;
+use File::Spec;
+use Test::More 'no_plan';
+
+require_ok( File::Spec->catfile( cwd(), qw( t lib mode.pl ) ) );
+
+use_ok( 'Crypt::Rijndael' );
+
+ok( defined &Crypt::Rijndael::MODE_CFB );
+diag( "MODE_CBFB is @{ [Crypt::Rijndael::MODE_CFB()] }" ) if $ENV{DEBUG};
+
+foreach my $a ( 0 .. 10 )
+ {
+ my $hash = crypt_decrypt( Crypt::Rijndael::MODE_CFB() );
+
+ is( $hash->{plain}, $hash->{data}, "Decrypted text matches plain text" );
+ }
Added: branches/upstream/libcrypt-rijndael-perl/current/t/ctr.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/ctr.t?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/ctr.t (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/ctr.t Fri Nov 9 22:54:08 2007
@@ -1,0 +1,19 @@
+#!/usr/bin/perl
+
+use Cwd;
+use File::Spec;
+use Test::More 'no_plan';
+
+require_ok( File::Spec->catfile( cwd(), qw( t lib mode.pl ) ) );
+
+use_ok( 'Crypt::Rijndael' );
+
+ok( defined &Crypt::Rijndael::MODE_CTR );
+diag( "MODE_CTR is @{ [Crypt::Rijndael::MODE_CTR()] }" ) if $ENV{DEBUG};
+
+foreach my $a ( 0 .. 10 )
+ {
+ my $hash = crypt_decrypt( Crypt::Rijndael::MODE_CTR() );
+
+ is( $hash->{plain}, $hash->{data}, "Decrypted text matches plain text" );
+ }
Added: branches/upstream/libcrypt-rijndael-perl/current/t/ecb.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/ecb.t?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/ecb.t (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/ecb.t Fri Nov 9 22:54:08 2007
@@ -1,0 +1,19 @@
+#!/usr/bin/perl
+
+use Cwd;
+use File::Spec;
+use Test::More 'no_plan';
+
+require_ok( File::Spec->catfile( cwd(), qw( t lib mode.pl ) ) );
+
+use_ok( 'Crypt::Rijndael' );
+
+ok( defined &Crypt::Rijndael::MODE_ECB );
+diag( "MODE_ECB is @{ [Crypt::Rijndael::MODE_ECB()] }" ) if $ENV{DEBUG};
+
+foreach my $a ( 0 .. 10 )
+ {
+ my $hash = crypt_decrypt( Crypt::Rijndael::MODE_ECB() );
+
+ is( $hash->{plain}, $hash->{data}, "Decrypted text matches plain text" );
+ }
Added: branches/upstream/libcrypt-rijndael-perl/current/t/lib/mode.pl
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/lib/mode.pl?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/lib/mode.pl (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/lib/mode.pl Fri Nov 9 22:54:08 2007
@@ -1,0 +1,35 @@
+use Crypt::Rijndael;
+
+sub crypt_decrypt
+ {
+ my( $mode ) = @_;
+
+ my $key = make_string( 32 );
+ my $c = Crypt::Rijndael->new( $key, $mode );
+
+ my $data = make_string( 32 * int( rand(16) + 1 ) );
+
+ my $cipher = $c->encrypt( $data );
+ my $plain = $c->decrypt( $cipher );
+
+ return {
+ data => $data,
+ cipher => $cipher,
+ plain => $plain,
+ };
+ }
+
+sub make_string {
+ my $size = shift;
+
+ my $res;
+
+ while( $size-- > 0 )
+ {
+ $res .= pack 'C', rand 256;
+ }
+
+ $res;
+ }
+
+1;
Added: branches/upstream/libcrypt-rijndael-perl/current/t/ofb.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/ofb.t?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/ofb.t (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/ofb.t Fri Nov 9 22:54:08 2007
@@ -1,0 +1,19 @@
+#!/usr/bin/perl
+
+use Cwd;
+use File::Spec;
+use Test::More 'no_plan';
+
+require_ok( File::Spec->catfile( cwd(), qw( t lib mode.pl ) ) );
+
+use_ok( 'Crypt::Rijndael' );
+
+ok( defined &Crypt::Rijndael::MODE_OFB );
+diag( "MODE_OFB is @{ [Crypt::Rijndael::MODE_OFB()] }" ) if $ENV{DEBUG};
+
+foreach my $a ( 0 .. 10 )
+ {
+ my $hash = crypt_decrypt( Crypt::Rijndael::MODE_OFB() );
+
+ is( $hash->{plain}, $hash->{data}, "Decrypted text matches plain text" );
+ }
Added: branches/upstream/libcrypt-rijndael-perl/current/t/pcbc.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/pcbc.t?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/pcbc.t (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/pcbc.t Fri Nov 9 22:54:08 2007
@@ -1,0 +1,26 @@
+#!/usr/bin/perl
+
+use Cwd;
+use File::Spec;
+use Test::More 'no_plan';
+
+require_ok( File::Spec->catfile( cwd(), qw( t lib mode.pl ) ) );
+
+use_ok( 'Crypt::Rijndael' );
+
+ok( defined &Crypt::Rijndael::MODE_PCBC );
+diag( "MODE_PCBC is @{ [Crypt::Rijndael::MODE_PCBC()] }" ) if $ENV{DEBUG};
+
+TODO: {
+ local $TODO = "PCBC is not a legal mode (yet)";
+
+my $value = eval {
+ foreach my $a ( 0 .. 10 )
+ {
+ my $hash = crypt_decrypt( Crypt::Rijndael::MODE_PCBC() );
+
+ is( $hash->{plain}, $hash->{data}, "Decrypted text matches plain text" );
+ }
+ };
+
+};
Added: branches/upstream/libcrypt-rijndael-perl/current/t/rt/27632.t
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/rt/27632.t?rev=9134&op=file
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/rt/27632.t (added)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/rt/27632.t Fri Nov 9 22:54:08 2007
@@ -1,0 +1,43 @@
+#!/usr/bin/perl
+
+use strict;
+use Crypt::Rijndael;
+use Digest::MD5 qw(md5_hex);
+
+use Test::More 'no_plan';
+
+my $class = 'Crypt::Rijndael';
+
+my $key = 'abcdefghijklmnop';
+
+my $in_plain = 'a' x 32;
+
+my $cipher = $class->new( $key, Crypt::Rijndael::MODE_CBC );
+isa_ok( $cipher, $class );
+
+$cipher->set_iv('a' x 16);
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# encrypt
+diag( "-" x 50 ) if $ENV{DEBUG};
+
+my $crypt = $cipher->encrypt( $in_plain );
+
+diag( "Plain text: [$in_plain]" ) if $ENV{DEBUG};
+diag( "Crypt text: [$crypt]" ) if $ENV{DEBUG};
+
+my $digest = md5_hex( $crypt );
+diag( "MD5 digest of crypt: [$digest]" ) if $ENV{DEBUG};
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# decrypt to see if we get back the same thing
+{
+diag( "-" x 50 ) if $ENV{DEBUG};
+
+my $out_plain = $cipher->decrypt( $crypt );
+
+diag( "Crypt text: [$crypt]" ) if $ENV{DEBUG};
+diag( "Plain text: [$out_plain]" ) if $ENV{DEBUG};
+
+is( $out_plain, $in_plain, "Text comes back correctly" );
+}
Modified: branches/upstream/libcrypt-rijndael-perl/current/t/test_manifest
URL: http://svn.debian.org/wsvn/branches/upstream/libcrypt-rijndael-perl/current/t/test_manifest?rev=9134&op=diff
==============================================================================
--- branches/upstream/libcrypt-rijndael-perl/current/t/test_manifest (original)
+++ branches/upstream/libcrypt-rijndael-perl/current/t/test_manifest Fri Nov 9 22:54:08 2007
@@ -1,5 +1,14 @@
-# $Id: test_manifest 2096 2007-01-25 19:48:41Z comdog $
+# $Id: test_manifest 2305 2007-09-12 20:29:54Z comdog $
00_load.t
pod.t
pod_coverage.t
+blocksize.t
+cbc.t
+cfb.t
+ctr.t
+ecb.t
+ofb.t
+pcbc.t
+#ref/cbc_d_m.t
+rt/27632.t
#bad_iv.t
More information about the Pkg-perl-cvs-commits
mailing list