#!/usr/bin/env perl
#
# $Id: $
#
# Module:  test -- description
# Created: 27-DEC-2007 23:54
# Author:  tmr
#

#use strict;
use warnings;

use Crypt::Rijndael;

$cbc = new Crypt::Rijndael pack("H*", "2b7e151628aed2a6abf7158809cf4f3c"), Crypt::Rijndael::MODE_CBC;
$cbc->set_iv(pack("H*", "000102030405060708090a0b0c0d0e0f"));
$plaintext = pack("H*", "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710");
$crypted = $cbc->encrypt($plaintext);
print unpack("H*", $crypted) eq "7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a7" ? "" : "not ", "ok 18\n";
print $cbc->decrypt($crypted) eq $plaintext ? "" : "not ", "ok 19\n";

# vim: fdm=syntax:fdn=3:tw=74:ts=2:syn=perl
