diff --git a/Changes b/Changes index a59cbff..bd3a429 100644 --- a/Changes +++ b/Changes @@ -1,11 +1,14 @@ Changes for CryptX -0.054_* 2017-10-XX +0.055 2017-11-28 - new Crypt::Cipher::IDEA - new Crypt::Cipher::Serpent - new Crypt::Stream::Salsa20 - new Crypt::Stream::Sosemanuk - - added CCM OO interface: new-add-add-done + - added CCM object oriented interface: new-add-add-done + - fix #39 accept CFLAGS and CPPFLAGS from the environment + - fix #40 typos in POD + - fix HMAC+SHA3 (now compliant with NIST test vectors) 0.054 2017-10-12 - fix Crypt::PK::DSA verify diff --git a/MANIFEST b/MANIFEST index d600b74..aa5da8b 100644 --- a/MANIFEST +++ b/MANIFEST @@ -672,6 +672,8 @@ t/001_compile.t t/002_all_pm.t t/003_all_pm_pod.t +t/004_all_pm_pod_spelling.t +t/005_all_pm_pod_coverage.t t/auth_enc_ccm.t t/auth_enc_ccm_test_vector_ltc.t t/auth_enc_chacha20poly1305.t @@ -925,6 +927,7 @@ t/mac_blake2s.t t/mac_f9.t t/mac_hmac.t +t/mac_hmac_nist.t t/mac_hmac_test_vectors_ltc.t t/mac_omac.t t/mac_omac_test_vectors_ltc.t diff --git a/META.json b/META.json index 803ab74..ea426ae 100644 --- a/META.json +++ b/META.json @@ -36,7 +36,7 @@ } } }, - "release_status" : "unstable", + "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/DCIT/perl-CryptX/issues" @@ -45,6 +45,6 @@ "url" : "https://github.com/DCIT/perl-CryptX" } }, - "version" : "0.054_006", + "version" : "0.055", "x_serialization_backend" : "JSON::PP version 2.94" } diff --git a/META.yml b/META.yml index 09f553e..92f1f4f 100644 --- a/META.yml +++ b/META.yml @@ -22,5 +22,5 @@ resources: bugtracker: https://github.com/DCIT/perl-CryptX/issues repository: https://github.com/DCIT/perl-CryptX -version: 0.054_006 +version: '0.055' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff --git a/Makefile.PL b/Makefile.PL index a27f4a7..e23147f 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -13,6 +13,10 @@ my $myextlib = "src/liballinone$Config{lib_ext}"; my $mycflags = "$Config{ccflags} $Config{cccdlflags} $Config{optimize}"; +#FIX: this is particularly useful for Debian https://github.com/DCIT/perl-CryptX/pull/39 +$mycflags .= " $ENV{CFLAGS}" if $ENV{CFLAGS}; +$mycflags .= " $ENV{CPPFLAGS}" if $ENV{CPPFLAGS}; + #FIX: gcc with -flto is a trouble maker see https://github.com/DCIT/perl-CryptX/issues/32 $mycflags =~ s/-flto\b//g; @@ -23,9 +27,6 @@ $mycflags =~ s/-ansi\b//g; $mycflags =~ s/-Wwrite-strings\b//g; $mycflags =~ s/-Wcast-qual\b//g; - -#FIX: this is particularly useful for Debian https://github.com/DCIT/perl-CryptX/pull/39 -$mycflags = "$ENV{CFLAGS} $ENV{CPPFLAGS}" if $ENV{CFLAGS} || $ENV{CPPFLAGS}; #FIX: avoid "ar: fatal: Numeric group ID too large" see https://github.com/DCIT/perl-CryptX/issues/33 my $myarflags = '$(AR_STATIC_ARGS)'; @@ -90,18 +91,22 @@ my $version_patch = q{ versionsync: $(NOECHO) perl _generators/version_patch.pl sync - versioninc: $(NOECHO) perl _generators/version_patch.pl inc - versionincdev: $(NOECHO) perl _generators/version_patch.pl incdev - versiondec: $(NOECHO) perl _generators/version_patch.pl dec - versiondecdev: $(NOECHO) perl _generators/version_patch.pl decdev +gencode: + $(NOECHO) perl _generators/gen.pl gencode +gentest: all + $(NOECHO) perl _generators/gen.pl gentest +openssltest: all + $(NOECHO) perl -Mblib t/openssl/dsa-test.pl + $(NOECHO) perl -Mblib t/openssl/ecc-test.pl + $(NOECHO) perl -Mblib t/openssl/rsa-test.pl }; return "$myextlib\n$version_patch"; diff --git a/README.md b/README.md index b6da31e..f59358d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # NAME -CryptX - Crypto toolkit (self-contained no external libraries needed) +CryptX - Cryptographic toolkit (self-contained, no external libraries needed) # DESCRIPTION @@ -8,7 +8,7 @@ Currently available modules: -- Ciphers - see [Crypt::Cipher](https://metacpan.org/pod/Crypt::Cipher) and related modules +- Symmetric ciphers - see [Crypt::Cipher](https://metacpan.org/pod/Crypt::Cipher) and related modules [Crypt::Cipher::AES](https://metacpan.org/pod/Crypt::Cipher::AES), [Crypt::Cipher::Anubis](https://metacpan.org/pod/Crypt::Cipher::Anubis), [Crypt::Cipher::Blowfish](https://metacpan.org/pod/Crypt::Cipher::Blowfish), [Crypt::Cipher::Camellia](https://metacpan.org/pod/Crypt::Cipher::Camellia), [Crypt::Cipher::CAST5](https://metacpan.org/pod/Crypt::Cipher::CAST5), [Crypt::Cipher::DES](https://metacpan.org/pod/Crypt::Cipher::DES), [Crypt::Cipher::DES\_EDE](https://metacpan.org/pod/Crypt::Cipher::DES_EDE), [Crypt::Cipher::IDEA](https://metacpan.org/pod/Crypt::Cipher::IDEA), [Crypt::Cipher::KASUMI](https://metacpan.org/pod/Crypt::Cipher::KASUMI), [Crypt::Cipher::Khazad](https://metacpan.org/pod/Crypt::Cipher::Khazad), [Crypt::Cipher::MULTI2](https://metacpan.org/pod/Crypt::Cipher::MULTI2), [Crypt::Cipher::Noekeon](https://metacpan.org/pod/Crypt::Cipher::Noekeon), @@ -22,7 +22,7 @@ - Stream ciphers - [Crypt::Stream::RC4](https://metacpan.org/pod/Crypt::Stream::RC4), [Crypt::Stream::ChaCha](https://metacpan.org/pod/Crypt::Stream::ChaCha), [Crypt::Stream::Salsa20](https://metacpan.org/pod/Crypt::Stream::Salsa20), [Crypt::Stream::Sober128](https://metacpan.org/pod/Crypt::Stream::Sober128) + [Crypt::Stream::RC4](https://metacpan.org/pod/Crypt::Stream::RC4), [Crypt::Stream::ChaCha](https://metacpan.org/pod/Crypt::Stream::ChaCha), [Crypt::Stream::Salsa20](https://metacpan.org/pod/Crypt::Stream::Salsa20), [Crypt::Stream::Sober128](https://metacpan.org/pod/Crypt::Stream::Sober128), [Crypt::Stream::Sosemanuk](https://metacpan.org/pod/Crypt::Stream::Sosemanuk) - Authenticated encryption modes @@ -37,9 +37,14 @@ [Crypt::Digest::SHA512](https://metacpan.org/pod/Crypt::Digest::SHA512), [Crypt::Digest::SHA512\_224](https://metacpan.org/pod/Crypt::Digest::SHA512_224), [Crypt::Digest::SHA512\_256](https://metacpan.org/pod/Crypt::Digest::SHA512_256), [Crypt::Digest::Tiger192](https://metacpan.org/pod/Crypt::Digest::Tiger192), [Crypt::Digest::Whirlpool](https://metacpan.org/pod/Crypt::Digest::Whirlpool), [Crypt::Digest::SHA3\_224](https://metacpan.org/pod/Crypt::Digest::SHA3_224), [Crypt::Digest::SHA3\_256](https://metacpan.org/pod/Crypt::Digest::SHA3_256), [Crypt::Digest::SHA3\_384](https://metacpan.org/pod/Crypt::Digest::SHA3_384), [Crypt::Digest::SHA3\_512](https://metacpan.org/pod/Crypt::Digest::SHA3_512), [Crypt::Digest::SHAKE](https://metacpan.org/pod/Crypt::Digest::SHAKE) +- Checksums + + [Crypt::Checksum](https://metacpan.org/pod/Crypt::Checksum), [Crypt::Checksum::Adler32](https://metacpan.org/pod/Crypt::Checksum::Adler32), [Crypt::Checksum::CRC32](https://metacpan.org/pod/Crypt::Checksum::CRC32) + - Message Authentication Codes - [Crypt::Mac::F9](https://metacpan.org/pod/Crypt::Mac::F9), [Crypt::Mac::HMAC](https://metacpan.org/pod/Crypt::Mac::HMAC), [Crypt::Mac::OMAC](https://metacpan.org/pod/Crypt::Mac::OMAC), [Crypt::Mac::Pelican](https://metacpan.org/pod/Crypt::Mac::Pelican), [Crypt::Mac::PMAC](https://metacpan.org/pod/Crypt::Mac::PMAC), [Crypt::Mac::XCBC](https://metacpan.org/pod/Crypt::Mac::XCBC), [Crypt::Mac::Poly1305](https://metacpan.org/pod/Crypt::Mac::Poly1305) + [Crypt::Mac::BLAKE2b](https://metacpan.org/pod/Crypt::Mac::BLAKE2b), [Crypt::Mac::BLAKE2s](https://metacpan.org/pod/Crypt::Mac::BLAKE2s), [Crypt::Mac::F9](https://metacpan.org/pod/Crypt::Mac::F9), [Crypt::Mac::HMAC](https://metacpan.org/pod/Crypt::Mac::HMAC), [Crypt::Mac::OMAC](https://metacpan.org/pod/Crypt::Mac::OMAC), + [Crypt::Mac::Pelican](https://metacpan.org/pod/Crypt::Mac::Pelican), [Crypt::Mac::PMAC](https://metacpan.org/pod/Crypt::Mac::PMAC), [Crypt::Mac::XCBC](https://metacpan.org/pod/Crypt::Mac::XCBC), [Crypt::Mac::Poly1305](https://metacpan.org/pod/Crypt::Mac::Poly1305) - Public key cryptography @@ -49,7 +54,7 @@ [Crypt::PRNG](https://metacpan.org/pod/Crypt::PRNG), [Crypt::PRNG::Fortuna](https://metacpan.org/pod/Crypt::PRNG::Fortuna), [Crypt::PRNG::Yarrow](https://metacpan.org/pod/Crypt::PRNG::Yarrow), [Crypt::PRNG::RC4](https://metacpan.org/pod/Crypt::PRNG::RC4), [Crypt::PRNG::Sober128](https://metacpan.org/pod/Crypt::PRNG::Sober128), [Crypt::PRNG::ChaCha20](https://metacpan.org/pod/Crypt::PRNG::ChaCha20) -- Key derivation functions - PBKDF1, PBKFD2 and HKDF +- Key derivation functions - PBKDF1, PBKDF2 and HKDF [Crypt::KeyDerivation](https://metacpan.org/pod/Crypt::KeyDerivation) diff --git a/inc/CryptX_AuthEnc_OCB.xs.inc b/inc/CryptX_AuthEnc_OCB.xs.inc index f21a051..e5a92ce 100644 --- a/inc/CryptX_AuthEnc_OCB.xs.inc +++ b/inc/CryptX_AuthEnc_OCB.xs.inc @@ -74,8 +74,8 @@ RETVAL = newSVpvn("", 0); } else { - if (in_data_len % (&self->state)->block_len) { - croak ("FATAL: sizeof(data) should be multiple of blocksize (%d)", (&self->state)->block_len); + if (in_data_len % 16) { + croak ("FATAL: sizeof(data) should be multiple of 16"); } RETVAL = NEWSV(0, in_data_len); SvPOK_only(RETVAL); @@ -135,8 +135,8 @@ RETVAL = newSVpvn("", 0); } else { - if (in_data_len % (&self->state)->block_len) { - croak ("FATAL: sizeof(data) should be multiple of blocksize (%d)", (&self->state)->block_len); + if (in_data_len % 16) { + croak ("FATAL: sizeof(data) should be multiple of 16"); } RETVAL = NEWSV(0, in_data_len); SvPOK_only(RETVAL); @@ -226,12 +226,3 @@ } } } - -int -blocksize(Crypt::AuthEnc::OCB self) - CODE: - { - RETVAL = (&self->state)->block_len; - } - OUTPUT: - RETVAL diff --git a/inc/CryptX_KeyDerivation.xs.inc b/inc/CryptX_KeyDerivation.xs.inc index 26f8a02..9e88d16 100644 --- a/inc/CryptX_KeyDerivation.xs.inc +++ b/inc/CryptX_KeyDerivation.xs.inc @@ -31,7 +31,7 @@ rv = pkcs_5_alg1(password_ptr, (unsigned long)password_len, salt_ptr, iteration_count, id, output, &output_len); if (rv != CRYPT_OK) { - SvREFCNT_dec(RETVAL); + SvREFCNT_dec(RETVAL); croak("FATAL: pkcs_5_alg1 process failed: %s", error_to_string(rv)); } SvCUR_set(RETVAL, output_len); @@ -69,7 +69,7 @@ rv = pkcs_5_alg2(password_ptr, (unsigned long)password_len, salt_ptr, (unsigned long)salt_len, iteration_count, id, output, &output_len); if (rv != CRYPT_OK) { - SvREFCNT_dec(RETVAL); + SvREFCNT_dec(RETVAL); croak("FATAL: pkcs_5_alg2 process failed: %s", error_to_string(rv)); } SvCUR_set(RETVAL, output_len); @@ -138,7 +138,7 @@ rv = hkdf_expand(id, info_ptr, (unsigned long)info_len, in_ptr, (unsigned long)in_len, output, output_len); if (rv != CRYPT_OK) { - SvREFCNT_dec(RETVAL); + SvREFCNT_dec(RETVAL); croak("FATAL: hkdf_expand process failed: %s", error_to_string(rv)); } SvCUR_set(RETVAL, output_len); @@ -179,7 +179,7 @@ rv = hkdf(id, salt_ptr, (unsigned long)salt_len, info_ptr, (unsigned long)info_len, in_ptr, (unsigned long)in_len, output, output_len); if (rv != CRYPT_OK) { - SvREFCNT_dec(RETVAL); + SvREFCNT_dec(RETVAL); croak("FATAL: hkdf_expand process failed: %s", error_to_string(rv)); } SvCUR_set(RETVAL, output_len); diff --git a/inc/CryptX_PK_DSA.xs.inc b/inc/CryptX_PK_DSA.xs.inc index 1b12620..3f8839b 100644 --- a/inc/CryptX_PK_DSA.xs.inc +++ b/inc/CryptX_PK_DSA.xs.inc @@ -141,7 +141,7 @@ size(Crypt::PK::DSA self) CODE: if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF; - RETVAL = mp_unsigned_bin_size(self->key.g); + RETVAL = mp_unsigned_bin_size(self->key.p); OUTPUT: RETVAL @@ -149,7 +149,7 @@ size_q(Crypt::PK::DSA self) CODE: if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF; - RETVAL = self->key.qord; + RETVAL = mp_unsigned_bin_size(self->key.q); OUTPUT: RETVAL diff --git a/lib/Crypt/AuthEnc/CCM.pm b/lib/Crypt/AuthEnc/CCM.pm index 9d0ea16..07349fb 100644 --- a/lib/Crypt/AuthEnc/CCM.pm +++ b/lib/Crypt/AuthEnc/CCM.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::AuthEnc Exporter); our %EXPORT_TAGS = ( all => [qw( ccm_encrypt_authenticate ccm_decrypt_verify )] ); @@ -96,7 +96,7 @@ =head1 DESCRIPTION -CCM is a encrypt+authenticate mode that is centered around using AES (or any 16-byte cipher) as aprimitive. +CCM is a encrypt+authenticate mode that is centered around using AES (or any 16-byte cipher) as a primitive. Unlike EAX and OCB mode, it is only meant for packet mode where the length of the input is known in advance. =head1 EXPORT @@ -174,3 +174,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/AuthEnc/ChaCha20Poly1305.pm b/lib/Crypt/AuthEnc/ChaCha20Poly1305.pm index 174f722..80da2eb 100644 --- a/lib/Crypt/AuthEnc/ChaCha20Poly1305.pm +++ b/lib/Crypt/AuthEnc/ChaCha20Poly1305.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::AuthEnc Exporter); our %EXPORT_TAGS = ( all => [qw( chacha20poly1305_encrypt_authenticate chacha20poly1305_decrypt_verify )] ); @@ -175,3 +175,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/AuthEnc/EAX.pm b/lib/Crypt/AuthEnc/EAX.pm index cbec9ef..68796ce 100644 --- a/lib/Crypt/AuthEnc/EAX.pm +++ b/lib/Crypt/AuthEnc/EAX.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::AuthEnc Exporter); our %EXPORT_TAGS = ( all => [qw( eax_encrypt_authenticate eax_decrypt_verify )] ); @@ -183,3 +183,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/AuthEnc/GCM.pm b/lib/Crypt/AuthEnc/GCM.pm index d105a3c..00a6a42 100644 --- a/lib/Crypt/AuthEnc/GCM.pm +++ b/lib/Crypt/AuthEnc/GCM.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::AuthEnc Exporter); our %EXPORT_TAGS = ( all => [qw( gcm_encrypt_authenticate gcm_decrypt_verify )] ); @@ -184,3 +184,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/AuthEnc/OCB.pm b/lib/Crypt/AuthEnc/OCB.pm index 17f7b63..ba69415 100644 --- a/lib/Crypt/AuthEnc/OCB.pm +++ b/lib/Crypt/AuthEnc/OCB.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::AuthEnc Exporter); our %EXPORT_TAGS = ( all => [qw( ocb_encrypt_authenticate ocb_decrypt_verify )] ); @@ -53,6 +53,7 @@ # obsolete, only for backwards compatibility sub aad_add { goto &adata_add } +sub blocksize { return 16 } 1; @@ -161,7 +162,7 @@ #BEWARE: size of $ciphertext has to be multiple of blocklen (16 for AES) -=head2 encrypt_last +=head2 decrypt_last $plaintext = $ae->decrypt_last($data); @@ -185,4 +186,6 @@ =item * L -=back \ No newline at end of file +=back + +=cut diff --git a/lib/Crypt/AuthEnc.pm b/lib/Crypt/AuthEnc.pm index 161fdad..5954905 100644 --- a/lib/Crypt/AuthEnc.pm +++ b/lib/Crypt/AuthEnc.pm @@ -2,16 +2,16 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; sub CLONE_SKIP { 1 } # prevent cloning 1; -__END__ +=pod =head1 NAME Crypt::AuthEnc - [internal only] -=cut \ No newline at end of file +=cut diff --git a/lib/Crypt/Checksum/Adler32.pm b/lib/Crypt/Checksum/Adler32.pm index 50bdcc0..a9f15bd 100644 --- a/lib/Crypt/Checksum/Adler32.pm +++ b/lib/Crypt/Checksum/Adler32.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Carp; $Carp::Internal{(__PACKAGE__)}++; @@ -120,4 +120,4 @@ =back -=cut \ No newline at end of file +=cut diff --git a/lib/Crypt/Checksum/CRC32.pm b/lib/Crypt/Checksum/CRC32.pm index f579774..4b1558b 100644 --- a/lib/Crypt/Checksum/CRC32.pm +++ b/lib/Crypt/Checksum/CRC32.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Carp; $Carp::Internal{(__PACKAGE__)}++; @@ -120,4 +120,4 @@ =back -=cut \ No newline at end of file +=cut diff --git a/lib/Crypt/Checksum.pm b/lib/Crypt/Checksum.pm index a4dd65b..f1f3670 100644 --- a/lib/Crypt/Checksum.pm +++ b/lib/Crypt/Checksum.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import'; our %EXPORT_TAGS = ( all => [qw/ @@ -106,7 +106,7 @@ =head2 adler32_data_int -Returns checksum as unsingned 32bit integer. +Returns checksum as unsigned 32bit integer. $checksum_hex = adler32_data_int('data string'); #or @@ -130,11 +130,11 @@ =head2 adler32_file_int -Returns checksum as unsingned 32bit integer. +Returns checksum as unsigned 32bit integer. - $checksum_hex = adler32_file_int('data string'); + $checksum_hex = adler32_file_int('filename.dat'); #or - $checksum_hex = adler32_file_int('any data', 'more data', 'even more data'); + $checksum_hex = adler32_file_int(*FILEHANDLE); =head2 crc32_data @@ -154,7 +154,7 @@ =head2 crc32_data_int -Returns checksum as unsingned 32bit integer. +Returns checksum as unsigned 32bit integer. $checksum_hex = crc32_data_int('data string'); #or @@ -178,11 +178,11 @@ =head2 crc32_file_int -Returns checksum as unsingned 32bit integer. +Returns checksum as unsigned 32bit integer. - $checksum_hex = crc32_file_int('data string'); + $checksum_hex = crc32_file_int('filename.dat'); #or - $checksum_hex = crc32_file_int('any data', 'more data', 'even more data'); + $checksum_hex = crc32_file_int(*FILEHANDLE); =head1 SEE ALSO @@ -196,4 +196,4 @@ =back -=cut \ No newline at end of file +=cut diff --git a/lib/Crypt/Cipher/AES.pm b/lib/Crypt/Cipher/AES.pm index 19aab10..21e757e 100644 --- a/lib/Crypt/Cipher/AES.pm +++ b/lib/Crypt/Cipher/AES.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::AES - Symetric cipher AES (aka Rijndael), key size: 128/192/256 bits (Crypt::CBC compliant) +Crypt::Cipher::AES - Symmetric cipher AES (aka Rijndael), key size: 128/192/256 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/Anubis.pm b/lib/Crypt/Cipher/Anubis.pm index d94823e..28765ad 100644 --- a/lib/Crypt/Cipher/Anubis.pm +++ b/lib/Crypt/Cipher/Anubis.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::Anubis - Symetric cipher Anubis, key size: 128-320 bits (Crypt::CBC compliant) +Crypt::Cipher::Anubis - Symmetric cipher Anubis, key size: 128-320 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/Blowfish.pm b/lib/Crypt/Cipher/Blowfish.pm index 8f08d63..d59ebee 100644 --- a/lib/Crypt/Cipher/Blowfish.pm +++ b/lib/Crypt/Cipher/Blowfish.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::Blowfish - Symetric cipher Blowfish, key size: 64-448 bits (Crypt::CBC compliant) +Crypt::Cipher::Blowfish - Symmetric cipher Blowfish, key size: 64-448 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/CAST5.pm b/lib/Crypt/Cipher/CAST5.pm index a403ea6..367fafe 100644 --- a/lib/Crypt/Cipher/CAST5.pm +++ b/lib/Crypt/Cipher/CAST5.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::CAST5 - Symetric cipher CAST5 (aka CAST-128), key size: 40-128 bits (Crypt::CBC compliant) +Crypt::Cipher::CAST5 - Symmetric cipher CAST5 (aka CAST-128), key size: 40-128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/Camellia.pm b/lib/Crypt/Cipher/Camellia.pm index 6f995db..901bcd5 100644 --- a/lib/Crypt/Cipher/Camellia.pm +++ b/lib/Crypt/Cipher/Camellia.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::Camellia - Symetric cipher Camellia, key size: 128/192/256 bits (Crypt::CBC compliant) +Crypt::Cipher::Camellia - Symmetric cipher Camellia, key size: 128/192/256 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/DES.pm b/lib/Crypt/Cipher/DES.pm index defcc0f..2d13225 100644 --- a/lib/Crypt/Cipher/DES.pm +++ b/lib/Crypt/Cipher/DES.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::DES - Symetric cipher DES, key size: 64[56] bits (Crypt::CBC compliant) +Crypt::Cipher::DES - Symmetric cipher DES, key size: 64[56] bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/DES_EDE.pm b/lib/Crypt/Cipher/DES_EDE.pm index 125554c..b423c49 100644 --- a/lib/Crypt/Cipher/DES_EDE.pm +++ b/lib/Crypt/Cipher/DES_EDE.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::DES_EDE - Symetric cipher DES_EDE (aka Tripple-DES, 3DES), key size: 192[168] bits (Crypt::CBC compliant) +Crypt::Cipher::DES_EDE - Symmetric cipher DES_EDE (aka Triple-DES, 3DES), key size: 192[168] bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/IDEA.pm b/lib/Crypt/Cipher/IDEA.pm index 176a407..af0129b 100644 --- a/lib/Crypt/Cipher/IDEA.pm +++ b/lib/Crypt/Cipher/IDEA.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::IDEA - Symetric cipher IDEA, key size: 128 bits (Crypt::CBC compliant) +Crypt::Cipher::IDEA - Symmetric cipher IDEA, key size: 128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/KASUMI.pm b/lib/Crypt/Cipher/KASUMI.pm index 54bafeb..0d9f318 100644 --- a/lib/Crypt/Cipher/KASUMI.pm +++ b/lib/Crypt/Cipher/KASUMI.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::KASUMI - Symetric cipher KASUMI, key size: 128 bits (Crypt::CBC compliant) +Crypt::Cipher::KASUMI - Symmetric cipher KASUMI, key size: 128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/Khazad.pm b/lib/Crypt/Cipher/Khazad.pm index a92602d..4ce84c5 100644 --- a/lib/Crypt/Cipher/Khazad.pm +++ b/lib/Crypt/Cipher/Khazad.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::Khazad - Symetric cipher Khazad, key size: 128 bits (Crypt::CBC compliant) +Crypt::Cipher::Khazad - Symmetric cipher Khazad, key size: 128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/MULTI2.pm b/lib/Crypt/Cipher/MULTI2.pm index a4651af..d037200 100644 --- a/lib/Crypt/Cipher/MULTI2.pm +++ b/lib/Crypt/Cipher/MULTI2.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::MULTI2 - Symetric cipher MULTI2, key size: 320 bits (Crypt::CBC compliant) +Crypt::Cipher::MULTI2 - Symmetric cipher MULTI2, key size: 320 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/Noekeon.pm b/lib/Crypt/Cipher/Noekeon.pm index c80cef5..a4911e1 100644 --- a/lib/Crypt/Cipher/Noekeon.pm +++ b/lib/Crypt/Cipher/Noekeon.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::Noekeon - Symetric cipher Noekeon, key size: 128 bits (Crypt::CBC compliant) +Crypt::Cipher::Noekeon - Symmetric cipher Noekeon, key size: 128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/RC2.pm b/lib/Crypt/Cipher/RC2.pm index 715bb4c..5ab35ec 100644 --- a/lib/Crypt/Cipher/RC2.pm +++ b/lib/Crypt/Cipher/RC2.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::RC2 - Symetric cipher RC2, key size: 40-1024 bits (Crypt::CBC compliant) +Crypt::Cipher::RC2 - Symmetric cipher RC2, key size: 40-1024 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/RC5.pm b/lib/Crypt/Cipher/RC5.pm index 683766a..ee78bd1 100644 --- a/lib/Crypt/Cipher/RC5.pm +++ b/lib/Crypt/Cipher/RC5.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::RC5 - Symetric cipher RC5, key size: 64-1024 bits (Crypt::CBC compliant) +Crypt::Cipher::RC5 - Symmetric cipher RC5, key size: 64-1024 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/RC6.pm b/lib/Crypt/Cipher/RC6.pm index 79f6e54..34ad9ee 100644 --- a/lib/Crypt/Cipher/RC6.pm +++ b/lib/Crypt/Cipher/RC6.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::RC6 - Symetric cipher RC6, key size: 64-1024 bits (Crypt::CBC compliant) +Crypt::Cipher::RC6 - Symmetric cipher RC6, key size: 64-1024 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/SAFERP.pm b/lib/Crypt/Cipher/SAFERP.pm index 4b0ee93..0e6e63a 100644 --- a/lib/Crypt/Cipher/SAFERP.pm +++ b/lib/Crypt/Cipher/SAFERP.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::SAFERP - Symetric cipher SAFER+, key size: 128/192/256 bits (Crypt::CBC compliant) +Crypt::Cipher::SAFERP - Symmetric cipher SAFER+, key size: 128/192/256 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/SAFER_K128.pm b/lib/Crypt/Cipher/SAFER_K128.pm index 6a4bbd2..7679502 100644 --- a/lib/Crypt/Cipher/SAFER_K128.pm +++ b/lib/Crypt/Cipher/SAFER_K128.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::SAFER_K128 - Symetric cipher SAFER_K128, key size: 128 bits (Crypt::CBC compliant) +Crypt::Cipher::SAFER_K128 - Symmetric cipher SAFER_K128, key size: 128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/SAFER_K64.pm b/lib/Crypt/Cipher/SAFER_K64.pm index 095d82c..c05c632 100644 --- a/lib/Crypt/Cipher/SAFER_K64.pm +++ b/lib/Crypt/Cipher/SAFER_K64.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::SAFER_K64 - Symetric cipher SAFER_K64, key size: 64 bits (Crypt::CBC compliant) +Crypt::Cipher::SAFER_K64 - Symmetric cipher SAFER_K64, key size: 64 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/SAFER_SK128.pm b/lib/Crypt/Cipher/SAFER_SK128.pm index d963fc9..7db08ca 100644 --- a/lib/Crypt/Cipher/SAFER_SK128.pm +++ b/lib/Crypt/Cipher/SAFER_SK128.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::SAFER_SK128 - Symetric cipher SAFER_SK128, key size: 128 bits (Crypt::CBC compliant) +Crypt::Cipher::SAFER_SK128 - Symmetric cipher SAFER_SK128, key size: 128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/SAFER_SK64.pm b/lib/Crypt/Cipher/SAFER_SK64.pm index a00a2c7..28a5dce 100644 --- a/lib/Crypt/Cipher/SAFER_SK64.pm +++ b/lib/Crypt/Cipher/SAFER_SK64.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::SAFER_SK64 - Symetric cipher SAFER_SK64, key size: 64 bits (Crypt::CBC compliant) +Crypt::Cipher::SAFER_SK64 - Symmetric cipher SAFER_SK64, key size: 64 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/SEED.pm b/lib/Crypt/Cipher/SEED.pm index c1a6d01..7117fdd 100644 --- a/lib/Crypt/Cipher/SEED.pm +++ b/lib/Crypt/Cipher/SEED.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::SEED - Symetric cipher SEED, key size: 128 bits (Crypt::CBC compliant) +Crypt::Cipher::SEED - Symmetric cipher SEED, key size: 128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/Serpent.pm b/lib/Crypt/Cipher/Serpent.pm index 2a992ad..0395145 100644 --- a/lib/Crypt/Cipher/Serpent.pm +++ b/lib/Crypt/Cipher/Serpent.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::Serpent - Symetric cipher Serpent, key size: 128/192/256 bits (Crypt::CBC compliant) +Crypt::Cipher::Serpent - Symmetric cipher Serpent, key size: 128/192/256 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/Skipjack.pm b/lib/Crypt/Cipher/Skipjack.pm index 84e8c2e..f8feae4 100644 --- a/lib/Crypt/Cipher/Skipjack.pm +++ b/lib/Crypt/Cipher/Skipjack.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::Skipjack - Symetric cipher Skipjack, key size: 80 bits (Crypt::CBC compliant) +Crypt::Cipher::Skipjack - Symmetric cipher Skipjack, key size: 80 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/Twofish.pm b/lib/Crypt/Cipher/Twofish.pm index 564ffb6..505b82c 100644 --- a/lib/Crypt/Cipher/Twofish.pm +++ b/lib/Crypt/Cipher/Twofish.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::Twofish - Symetric cipher Twofish, key size: 128/192/256 bits (Crypt::CBC compliant) +Crypt::Cipher::Twofish - Symmetric cipher Twofish, key size: 128/192/256 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher/XTEA.pm b/lib/Crypt/Cipher/XTEA.pm index c90e18f..3ca22ad 100644 --- a/lib/Crypt/Cipher/XTEA.pm +++ b/lib/Crypt/Cipher/XTEA.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; use base 'Crypt::Cipher'; @@ -21,7 +21,7 @@ =head1 NAME -Crypt::Cipher::XTEA - Symetric cipher XTEA, key size: 128 bits (Crypt::CBC compliant) +Crypt::Cipher::XTEA - Symmetric cipher XTEA, key size: 128 bits (Crypt::CBC compliant) =head1 SYNOPSIS @@ -117,5 +117,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Cipher.pm b/lib/Crypt/Cipher.pm index 19fccc6..7b31cd0 100644 --- a/lib/Crypt/Cipher.pm +++ b/lib/Crypt/Cipher.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Carp; $Carp::Internal{(__PACKAGE__)}++; @@ -129,7 +129,7 @@ =head1 DESCRIPTION -Provides an interface to various symetric cipher algorithms. +Provides an interface to various symmetric cipher algorithms. B This module implements just elementary "one-block-(en|de)cryption" operation - if you want to encrypt/decrypt generic data you have to use some of the cipher block modes - check for example @@ -150,7 +150,7 @@ # simply any for which there exists Crypt::Cipher:: # $key = binary key (keysize should comply with selected cipher requirements) - ## some of the ciphers (e.g. MULTI2, RC5, SAFER) allows to set number of rounds + ## some of the ciphers (e.g. MULTI2, RC5, SAFER) allow one to set number of rounds $d = Crypt::Cipher->new('MULTI2', $key, $rounds); # $rounds = positive integer (should comply with selected cipher requirements) @@ -202,7 +202,7 @@ =head2 default_rounds -Returns default number of rounds for given cipher. NOTE: only some cipher (e.g. MULTI2, RC5, SAFER) allows to set number of rounds via new(). +Returns default number of rounds for given cipher. NOTE: only some ciphers (e.g. MULTI2, RC5, SAFER) allow one to set number of rounds via new(). $d->default_rounds; #or @@ -221,5 +221,3 @@ =back =cut - -__END__ diff --git a/lib/Crypt/Digest/BLAKE2b_160.pm b/lib/Crypt/Digest/BLAKE2b_160.pm index 6757876..e7d2cd9 100644 --- a/lib/Crypt/Digest/BLAKE2b_160.pm +++ b/lib/Crypt/Digest/BLAKE2b_160.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( blake2b_160 blake2b_160_hex blake2b_160_b64 blake2b_160_b64u blake2b_160_file blake2b_160_file_hex blake2b_160_file_b64 blake2b_160_file_b64u )] ); @@ -225,5 +225,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/BLAKE2b_256.pm b/lib/Crypt/Digest/BLAKE2b_256.pm index e1e27d9..431a1be 100644 --- a/lib/Crypt/Digest/BLAKE2b_256.pm +++ b/lib/Crypt/Digest/BLAKE2b_256.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( blake2b_256 blake2b_256_hex blake2b_256_b64 blake2b_256_b64u blake2b_256_file blake2b_256_file_hex blake2b_256_file_b64 blake2b_256_file_b64u )] ); @@ -225,5 +225,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/BLAKE2b_384.pm b/lib/Crypt/Digest/BLAKE2b_384.pm index cd045fe..8a74df1 100644 --- a/lib/Crypt/Digest/BLAKE2b_384.pm +++ b/lib/Crypt/Digest/BLAKE2b_384.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( blake2b_384 blake2b_384_hex blake2b_384_b64 blake2b_384_b64u blake2b_384_file blake2b_384_file_hex blake2b_384_file_b64 blake2b_384_file_b64u )] ); @@ -225,5 +225,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/BLAKE2b_512.pm b/lib/Crypt/Digest/BLAKE2b_512.pm index 04ec858..4405c00 100644 --- a/lib/Crypt/Digest/BLAKE2b_512.pm +++ b/lib/Crypt/Digest/BLAKE2b_512.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( blake2b_512 blake2b_512_hex blake2b_512_b64 blake2b_512_b64u blake2b_512_file blake2b_512_file_hex blake2b_512_file_b64 blake2b_512_file_b64u )] ); @@ -225,5 +225,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/BLAKE2s_128.pm b/lib/Crypt/Digest/BLAKE2s_128.pm index 9c47dea..394ca79 100644 --- a/lib/Crypt/Digest/BLAKE2s_128.pm +++ b/lib/Crypt/Digest/BLAKE2s_128.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( blake2s_128 blake2s_128_hex blake2s_128_b64 blake2s_128_b64u blake2s_128_file blake2s_128_file_hex blake2s_128_file_b64 blake2s_128_file_b64u )] ); @@ -225,5 +225,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/BLAKE2s_160.pm b/lib/Crypt/Digest/BLAKE2s_160.pm index 81398bd..6d0d77a 100644 --- a/lib/Crypt/Digest/BLAKE2s_160.pm +++ b/lib/Crypt/Digest/BLAKE2s_160.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( blake2s_160 blake2s_160_hex blake2s_160_b64 blake2s_160_b64u blake2s_160_file blake2s_160_file_hex blake2s_160_file_b64 blake2s_160_file_b64u )] ); @@ -225,5 +225,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/BLAKE2s_224.pm b/lib/Crypt/Digest/BLAKE2s_224.pm index 1a67e01..48c3bd0 100644 --- a/lib/Crypt/Digest/BLAKE2s_224.pm +++ b/lib/Crypt/Digest/BLAKE2s_224.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( blake2s_224 blake2s_224_hex blake2s_224_b64 blake2s_224_b64u blake2s_224_file blake2s_224_file_hex blake2s_224_file_b64 blake2s_224_file_b64u )] ); @@ -225,5 +225,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/BLAKE2s_256.pm b/lib/Crypt/Digest/BLAKE2s_256.pm index c60083f..8776bf8 100644 --- a/lib/Crypt/Digest/BLAKE2s_256.pm +++ b/lib/Crypt/Digest/BLAKE2s_256.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( blake2s_256 blake2s_256_hex blake2s_256_b64 blake2s_256_b64u blake2s_256_file blake2s_256_file_hex blake2s_256_file_b64 blake2s_256_file_b64u )] ); @@ -225,5 +225,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/CHAES.pm b/lib/Crypt/Digest/CHAES.pm index 85bd687..469a2fe 100644 --- a/lib/Crypt/Digest/CHAES.pm +++ b/lib/Crypt/Digest/CHAES.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( chaes chaes_hex chaes_b64 chaes_b64u chaes_file chaes_file_hex chaes_file_b64 chaes_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/MD2.pm b/lib/Crypt/Digest/MD2.pm index 6e539ca..9059991 100644 --- a/lib/Crypt/Digest/MD2.pm +++ b/lib/Crypt/Digest/MD2.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( md2 md2_hex md2_b64 md2_b64u md2_file md2_file_hex md2_file_b64 md2_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/MD4.pm b/lib/Crypt/Digest/MD4.pm index 4dde9b8..bf18d11 100644 --- a/lib/Crypt/Digest/MD4.pm +++ b/lib/Crypt/Digest/MD4.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( md4 md4_hex md4_b64 md4_b64u md4_file md4_file_hex md4_file_b64 md4_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/MD5.pm b/lib/Crypt/Digest/MD5.pm index e6c537c..5aad14f 100644 --- a/lib/Crypt/Digest/MD5.pm +++ b/lib/Crypt/Digest/MD5.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( md5 md5_hex md5_b64 md5_b64u md5_file md5_file_hex md5_file_b64 md5_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/RIPEMD128.pm b/lib/Crypt/Digest/RIPEMD128.pm index 49a7b50..52db462 100644 --- a/lib/Crypt/Digest/RIPEMD128.pm +++ b/lib/Crypt/Digest/RIPEMD128.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( ripemd128 ripemd128_hex ripemd128_b64 ripemd128_b64u ripemd128_file ripemd128_file_hex ripemd128_file_b64 ripemd128_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/RIPEMD160.pm b/lib/Crypt/Digest/RIPEMD160.pm index 5a6ee18..fd24d94 100644 --- a/lib/Crypt/Digest/RIPEMD160.pm +++ b/lib/Crypt/Digest/RIPEMD160.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( ripemd160 ripemd160_hex ripemd160_b64 ripemd160_b64u ripemd160_file ripemd160_file_hex ripemd160_file_b64 ripemd160_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/RIPEMD256.pm b/lib/Crypt/Digest/RIPEMD256.pm index 2f20d9b..bb5d873 100644 --- a/lib/Crypt/Digest/RIPEMD256.pm +++ b/lib/Crypt/Digest/RIPEMD256.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( ripemd256 ripemd256_hex ripemd256_b64 ripemd256_b64u ripemd256_file ripemd256_file_hex ripemd256_file_b64 ripemd256_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/RIPEMD320.pm b/lib/Crypt/Digest/RIPEMD320.pm index 0c83285..7f315d5 100644 --- a/lib/Crypt/Digest/RIPEMD320.pm +++ b/lib/Crypt/Digest/RIPEMD320.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( ripemd320 ripemd320_hex ripemd320_b64 ripemd320_b64u ripemd320_file ripemd320_file_hex ripemd320_file_b64 ripemd320_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA1.pm b/lib/Crypt/Digest/SHA1.pm index bcab4bf..e746768 100644 --- a/lib/Crypt/Digest/SHA1.pm +++ b/lib/Crypt/Digest/SHA1.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha1 sha1_hex sha1_b64 sha1_b64u sha1_file sha1_file_hex sha1_file_b64 sha1_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA224.pm b/lib/Crypt/Digest/SHA224.pm index cdf930a..e244ee8 100644 --- a/lib/Crypt/Digest/SHA224.pm +++ b/lib/Crypt/Digest/SHA224.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha224 sha224_hex sha224_b64 sha224_b64u sha224_file sha224_file_hex sha224_file_b64 sha224_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA256.pm b/lib/Crypt/Digest/SHA256.pm index cff5c71..5119b60 100644 --- a/lib/Crypt/Digest/SHA256.pm +++ b/lib/Crypt/Digest/SHA256.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha256 sha256_hex sha256_b64 sha256_b64u sha256_file sha256_file_hex sha256_file_b64 sha256_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA384.pm b/lib/Crypt/Digest/SHA384.pm index 94a2e83..7a47e8c 100644 --- a/lib/Crypt/Digest/SHA384.pm +++ b/lib/Crypt/Digest/SHA384.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha384 sha384_hex sha384_b64 sha384_b64u sha384_file sha384_file_hex sha384_file_b64 sha384_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA3_224.pm b/lib/Crypt/Digest/SHA3_224.pm index 6b812d2..5806533 100644 --- a/lib/Crypt/Digest/SHA3_224.pm +++ b/lib/Crypt/Digest/SHA3_224.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha3_224 sha3_224_hex sha3_224_b64 sha3_224_b64u sha3_224_file sha3_224_file_hex sha3_224_file_b64 sha3_224_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA3_256.pm b/lib/Crypt/Digest/SHA3_256.pm index 4358820..e87070d 100644 --- a/lib/Crypt/Digest/SHA3_256.pm +++ b/lib/Crypt/Digest/SHA3_256.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha3_256 sha3_256_hex sha3_256_b64 sha3_256_b64u sha3_256_file sha3_256_file_hex sha3_256_file_b64 sha3_256_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA3_384.pm b/lib/Crypt/Digest/SHA3_384.pm index 2bdbd4b..21b673a 100644 --- a/lib/Crypt/Digest/SHA3_384.pm +++ b/lib/Crypt/Digest/SHA3_384.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha3_384 sha3_384_hex sha3_384_b64 sha3_384_b64u sha3_384_file sha3_384_file_hex sha3_384_file_b64 sha3_384_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA3_512.pm b/lib/Crypt/Digest/SHA3_512.pm index 15f160c..f3051dc 100644 --- a/lib/Crypt/Digest/SHA3_512.pm +++ b/lib/Crypt/Digest/SHA3_512.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha3_512 sha3_512_hex sha3_512_b64 sha3_512_b64u sha3_512_file sha3_512_file_hex sha3_512_file_b64 sha3_512_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA512.pm b/lib/Crypt/Digest/SHA512.pm index 2a21513..c064a31 100644 --- a/lib/Crypt/Digest/SHA512.pm +++ b/lib/Crypt/Digest/SHA512.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha512 sha512_hex sha512_b64 sha512_b64u sha512_file sha512_file_hex sha512_file_b64 sha512_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA512_224.pm b/lib/Crypt/Digest/SHA512_224.pm index d98e6e6..096393f 100644 --- a/lib/Crypt/Digest/SHA512_224.pm +++ b/lib/Crypt/Digest/SHA512_224.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha512_224 sha512_224_hex sha512_224_b64 sha512_224_b64u sha512_224_file sha512_224_file_hex sha512_224_file_b64 sha512_224_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHA512_256.pm b/lib/Crypt/Digest/SHA512_256.pm index c7efdbb..08ab198 100644 --- a/lib/Crypt/Digest/SHA512_256.pm +++ b/lib/Crypt/Digest/SHA512_256.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( sha512_256 sha512_256_hex sha512_256_b64 sha512_256_b64u sha512_256_file sha512_256_file_hex sha512_256_file_b64 sha512_256_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/SHAKE.pm b/lib/Crypt/Digest/SHAKE.pm index fb52afe..1e5b79d 100644 --- a/lib/Crypt/Digest/SHAKE.pm +++ b/lib/Crypt/Digest/SHAKE.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Carp; $Carp::Internal{(__PACKAGE__)}++; @@ -102,5 +102,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/Tiger192.pm b/lib/Crypt/Digest/Tiger192.pm index 13b785a..54f627a 100644 --- a/lib/Crypt/Digest/Tiger192.pm +++ b/lib/Crypt/Digest/Tiger192.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( tiger192 tiger192_hex tiger192_b64 tiger192_b64u tiger192_file tiger192_file_hex tiger192_file_b64 tiger192_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest/Whirlpool.pm b/lib/Crypt/Digest/Whirlpool.pm index 29d9ffa..692573b 100644 --- a/lib/Crypt/Digest/Whirlpool.pm +++ b/lib/Crypt/Digest/Whirlpool.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Digest Exporter); our %EXPORT_TAGS = ( all => [qw( whirlpool whirlpool_hex whirlpool_b64 whirlpool_b64u whirlpool_file whirlpool_file_hex whirlpool_file_b64 whirlpool_file_b64u )] ); @@ -223,5 +223,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Digest.pm b/lib/Crypt/Digest.pm index 1cab88d..2f30ca3 100644 --- a/lib/Crypt/Digest.pm +++ b/lib/Crypt/Digest.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import'; our %EXPORT_TAGS = ( all => [qw( digest_data digest_data_hex digest_data_b64 digest_data_b64u digest_file digest_file_hex digest_file_b64 digest_file_b64u )] ); @@ -176,7 +176,7 @@ =head1 FUNCTIONS -Please note that all functions take as its first argument the algoritm name, supported values are: +Please note that all functions take as its first argument the algorithm name, supported values are: 'CHAES', 'MD2', 'MD4', 'MD5', 'RIPEMD128', 'RIPEMD160', 'RIPEMD256', 'RIPEMD320', 'SHA1', 'SHA224', 'SHA256', @@ -373,5 +373,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/KeyDerivation.pm b/lib/Crypt/KeyDerivation.pm index 613f0ae..71176f1 100644 --- a/lib/Crypt/KeyDerivation.pm +++ b/lib/Crypt/KeyDerivation.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import'; our %EXPORT_TAGS = ( all => [qw(pbkdf1 pbkdf2 hkdf hkdf_expand hkdf_extract)] ); @@ -70,7 +70,7 @@ =head1 NAME -Crypt::KeyDerivation - PBKDF1, PBKFD2 and HKDF key derivation functions +Crypt::KeyDerivation - PBKDF1, PBKDF2 and HKDF key derivation functions =head1 SYNOPSIS @@ -89,7 +89,7 @@ =over -=item * PBKFD1 and PBKDF according to PKCS#5 v2.0 L +=item * PBKDF1 and PBKDF according to PKCS#5 v2.0 L =item * HKDF (+ related) according to L @@ -172,3 +172,5 @@ # $hash_name .. optional, DEFAULT: 'SHA256' # $len ........ optional, derived key len, DEFAULT: 32 # $info ....... optional context and application specific information, DEFAULT: '' + +=cut diff --git a/lib/Crypt/Mac/BLAKE2b.pm b/lib/Crypt/Mac/BLAKE2b.pm index d35d7f6..2a0a87c 100644 --- a/lib/Crypt/Mac/BLAKE2b.pm +++ b/lib/Crypt/Mac/BLAKE2b.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( blake2b blake2b_hex blake2b_b64 blake2b_b64u )] ); @@ -152,5 +152,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac/BLAKE2s.pm b/lib/Crypt/Mac/BLAKE2s.pm index 9147246..69a03b2 100644 --- a/lib/Crypt/Mac/BLAKE2s.pm +++ b/lib/Crypt/Mac/BLAKE2s.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( blake2s blake2s_hex blake2s_b64 blake2s_b64u )] ); @@ -152,5 +152,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac/F9.pm b/lib/Crypt/Mac/F9.pm index 7bc89db..2adc45d 100644 --- a/lib/Crypt/Mac/F9.pm +++ b/lib/Crypt/Mac/F9.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( f9 f9_hex f9_b64 f9_b64u )] ); @@ -152,5 +152,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac/HMAC.pm b/lib/Crypt/Mac/HMAC.pm index dbfee7b..3c9b983 100644 --- a/lib/Crypt/Mac/HMAC.pm +++ b/lib/Crypt/Mac/HMAC.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( hmac hmac_hex hmac_b64 hmac_b64u )] ); @@ -171,5 +171,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac/OMAC.pm b/lib/Crypt/Mac/OMAC.pm index 0f18146..cccd4ed 100644 --- a/lib/Crypt/Mac/OMAC.pm +++ b/lib/Crypt/Mac/OMAC.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( omac omac_hex omac_b64 omac_b64u )] ); @@ -154,5 +154,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac/PMAC.pm b/lib/Crypt/Mac/PMAC.pm index 5070280..3d96340 100644 --- a/lib/Crypt/Mac/PMAC.pm +++ b/lib/Crypt/Mac/PMAC.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( pmac pmac_hex pmac_b64 pmac_b64u )] ); @@ -154,5 +154,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac/Pelican.pm b/lib/Crypt/Mac/Pelican.pm index 2b89572..a2eea08 100644 --- a/lib/Crypt/Mac/Pelican.pm +++ b/lib/Crypt/Mac/Pelican.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( pelican pelican_hex pelican_b64 pelican_b64u )] ); @@ -152,5 +152,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac/Poly1305.pm b/lib/Crypt/Mac/Poly1305.pm index 6afc499..92c79c9 100644 --- a/lib/Crypt/Mac/Poly1305.pm +++ b/lib/Crypt/Mac/Poly1305.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( poly1305 poly1305_hex poly1305_b64 poly1305_b64u )] ); @@ -152,5 +152,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac/XCBC.pm b/lib/Crypt/Mac/XCBC.pm index dbc3be9..c364462 100644 --- a/lib/Crypt/Mac/XCBC.pm +++ b/lib/Crypt/Mac/XCBC.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::Mac Exporter); our %EXPORT_TAGS = ( all => [qw( xcbc xcbc_hex xcbc_b64 xcbc_b64u )] ); @@ -154,5 +154,3 @@ =back =cut - -__END__ \ No newline at end of file diff --git a/lib/Crypt/Mac.pm b/lib/Crypt/Mac.pm index e5e1d3f..a71df92 100644 --- a/lib/Crypt/Mac.pm +++ b/lib/Crypt/Mac.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import'; our %EXPORT_TAGS = ( all => [qw( mac mac_hex )] ); @@ -50,10 +50,10 @@ 1; -__END__ +=pod =head1 NAME Crypt::Mac - [internal only] -=cut \ No newline at end of file +=cut diff --git a/lib/Crypt/Misc.pm b/lib/Crypt/Misc.pm index aeab25d..13a861f 100644 --- a/lib/Crypt/Misc.pm +++ b/lib/Crypt/Misc.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import'; use Carp 'croak'; diff --git a/lib/Crypt/Mode/CBC.pm b/lib/Crypt/Mode/CBC.pm index aaf7cfd..5bb3773 100644 --- a/lib/Crypt/Mode/CBC.pm +++ b/lib/Crypt/Mode/CBC.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Crypt::Cipher; use base 'Crypt::Mode'; @@ -115,3 +115,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/Mode/CFB.pm b/lib/Crypt/Mode/CFB.pm index cae4778..8e6cd34 100644 --- a/lib/Crypt/Mode/CFB.pm +++ b/lib/Crypt/Mode/CFB.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Crypt::Cipher; use base 'Crypt::Mode'; @@ -92,3 +92,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/Mode/CTR.pm b/lib/Crypt/Mode/CTR.pm index 22a6402..eec1f73 100644 --- a/lib/Crypt/Mode/CTR.pm +++ b/lib/Crypt/Mode/CTR.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Crypt::Cipher; use base 'Crypt::Mode'; @@ -99,3 +99,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/Mode/ECB.pm b/lib/Crypt/Mode/ECB.pm index 0de0dee..df77604 100644 --- a/lib/Crypt/Mode/ECB.pm +++ b/lib/Crypt/Mode/ECB.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Crypt::Cipher; use base 'Crypt::Mode'; @@ -116,3 +116,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/Mode/OFB.pm b/lib/Crypt/Mode/OFB.pm index ba38da4..b8bce1b 100644 --- a/lib/Crypt/Mode/OFB.pm +++ b/lib/Crypt/Mode/OFB.pm @@ -4,7 +4,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Crypt::Cipher; use base 'Crypt::Mode'; @@ -92,3 +92,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/Mode.pm b/lib/Crypt/Mode.pm index d5d40bf..4b07940 100644 --- a/lib/Crypt/Mode.pm +++ b/lib/Crypt/Mode.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; ### METHODS @@ -63,10 +63,10 @@ 1; -__END__ +=pod =head1 NAME Crypt::Mode - [internal only] -=cut \ No newline at end of file +=cut diff --git a/lib/Crypt/PK/DH.pm b/lib/Crypt/PK/DH.pm index 1f3927e..fc6ca50 100644 --- a/lib/Crypt/PK/DH.pm +++ b/lib/Crypt/PK/DH.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import'; our %EXPORT_TAGS = ( all => [qw( dh_shared_secret )] ); @@ -328,7 +328,7 @@ random data taken from C (UNIX) or C (Win32). $pk->generate_key($groupsize); - ### $groupsize (in bytes) corresponds to DH params (p, g) predefined by libtomcrypt + ### $groupsize (in bytes) corresponds to DH parameters (p, g) predefined by libtomcrypt # 96 => DH-768 # 128 => DH-1024 # 192 => DH-1536 @@ -356,7 +356,7 @@ # where $g is the generator (base) in a hex string and $p is the prime in a hex string $pk->generate_key(\$dh_param) - # $dh_param is the content of DER or PEM file with DH params + # $dh_param is the content of DER or PEM file with DH parameters # e.g. openssl dhparam 2048 =head2 import_key @@ -379,7 +379,7 @@ =head2 export_key -B DH key format change - since v0.049 it is compatible with libtocrypt 1.18. +B DH key format change - since v0.049 it is compatible with libtomcrypt 1.18. my $private = $pk->export_key('private'); #or @@ -480,3 +480,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PK/DSA.pm b/lib/Crypt/PK/DSA.pm index df38e8c..5f1b581 100644 --- a/lib/Crypt/PK/DSA.pm +++ b/lib/Crypt/PK/DSA.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import'; our %EXPORT_TAGS = ( all => [qw( dsa_encrypt dsa_decrypt dsa_sign_message dsa_verify_message dsa_sign_hash dsa_verify_hash )] ); @@ -473,7 +473,12 @@ =head2 size my $size = $pk->size; - # returns key size in bytes or undef if no key loaded + # returns key size (length of the prime p) in bytes or undef if key not loaded + +=head2 size_q + + my $size = $pk->size_q; + # returns length of the prime q in bytes or undef if key not loaded =head2 key2hash @@ -643,3 +648,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PK/ECC.pm b/lib/Crypt/PK/ECC.pm index 8b0544f..caa266f 100644 --- a/lib/Crypt/PK/ECC.pm +++ b/lib/Crypt/PK/ECC.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import'; our %EXPORT_TAGS = ( all => [qw( ecc_encrypt ecc_decrypt ecc_sign_message ecc_verify_message ecc_sign_hash ecc_verify_hash ecc_shared_secret )] ); @@ -774,7 +774,7 @@ #or $pk->generate_key($hashref_with_curve_params); -The following pre-defined C<$curve_name> values are supported: +The following predefined C<$curve_name> values are supported: # curves from http://www.ecc-brainpool.org/download/Domain-parameters.pdf 'brainpoolp160r1' @@ -1029,7 +1029,7 @@ my $public_der = $pk->export_key_der('public'); Since CryptX-0.36 C can also export keys in a format -that does not explicitely contain curve parameters but only curve OID. +that does not explicitly contain curve parameters but only curve OID. my $private_der = $pk->export_key_der('private_short'); #or @@ -1042,7 +1042,7 @@ my $public_pem = $pk->export_key_pem('public'); Since CryptX-0.36 C can also export keys in a format -that does not explicitely contain curve parameters but only curve OID. +that does not explicitly contain curve parameters but only curve OID. my $private_pem = $pk->export_key_pem('private_short'); #or @@ -1395,3 +1395,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PK/RSA.pm b/lib/Crypt/PK/RSA.pm index 3887b62..6afccd9 100644 --- a/lib/Crypt/PK/RSA.pm +++ b/lib/Crypt/PK/RSA.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import'; our %EXPORT_TAGS = ( all => [qw(rsa_encrypt rsa_decrypt rsa_sign_message rsa_verify_message rsa_sign_hash rsa_verify_hash)] ); @@ -961,3 +961,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PK.pm b/lib/Crypt/PK.pm index 2ee0a20..d48e840 100644 --- a/lib/Crypt/PK.pm +++ b/lib/Crypt/PK.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use Carp; @@ -24,10 +24,10 @@ 1; -__END__ +=pod =head1 NAME Crypt::PK - [internal only] -=cut \ No newline at end of file +=cut diff --git a/lib/Crypt/PRNG/ChaCha20.pm b/lib/Crypt/PRNG/ChaCha20.pm index 9e0be0c..c6547eb 100644 --- a/lib/Crypt/PRNG/ChaCha20.pm +++ b/lib/Crypt/PRNG/ChaCha20.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::PRNG Exporter); our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] ); @@ -157,3 +157,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PRNG/Fortuna.pm b/lib/Crypt/PRNG/Fortuna.pm index 11cfb04..01c2b80 100644 --- a/lib/Crypt/PRNG/Fortuna.pm +++ b/lib/Crypt/PRNG/Fortuna.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::PRNG Exporter); our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] ); @@ -158,3 +158,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PRNG/RC4.pm b/lib/Crypt/PRNG/RC4.pm index b183c29..6eef285 100644 --- a/lib/Crypt/PRNG/RC4.pm +++ b/lib/Crypt/PRNG/RC4.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::PRNG Exporter); our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] ); @@ -157,3 +157,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PRNG/Sober128.pm b/lib/Crypt/PRNG/Sober128.pm index 930a501..fd1bfc5 100644 --- a/lib/Crypt/PRNG/Sober128.pm +++ b/lib/Crypt/PRNG/Sober128.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::PRNG Exporter); our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] ); @@ -157,3 +157,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PRNG/Yarrow.pm b/lib/Crypt/PRNG/Yarrow.pm index 828619b..f94c5e4 100644 --- a/lib/Crypt/PRNG/Yarrow.pm +++ b/lib/Crypt/PRNG/Yarrow.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Crypt::PRNG Exporter); our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] ); @@ -156,3 +156,5 @@ =item * L =back + +=cut diff --git a/lib/Crypt/PRNG.pm b/lib/Crypt/PRNG.pm index 244dac2..7086880 100644 --- a/lib/Crypt/PRNG.pm +++ b/lib/Crypt/PRNG.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Exporter); our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] ); @@ -193,13 +193,13 @@ #or $n = rand($limit); -Returns a random floating point number from range C<[0,1)> (if called without param) or C<[0,$limit)>. +Returns a random floating point number from range C<[0,1)> (if called without parameter) or C<[0,$limit)>. =head2 irand $i = irand; -Returns a random unsigned 32bit integer - range 0 .. 0xFFFFFFFF. +Returns a random unsigned 32bit integer - range C<0 .. 0xFFFFFFFF>. =head1 METHODS @@ -280,4 +280,6 @@ =head1 SEE ALSO -L, L, L, L \ No newline at end of file +L, L, L, L + +=cut diff --git a/lib/Crypt/Stream/ChaCha.pm b/lib/Crypt/Stream/ChaCha.pm index 4e4326c..488b1b1 100644 --- a/lib/Crypt/Stream/ChaCha.pm +++ b/lib/Crypt/Stream/ChaCha.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; diff --git a/lib/Crypt/Stream/RC4.pm b/lib/Crypt/Stream/RC4.pm index 18db4b7..b6f6cf7 100644 --- a/lib/Crypt/Stream/RC4.pm +++ b/lib/Crypt/Stream/RC4.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; diff --git a/lib/Crypt/Stream/Salsa20.pm b/lib/Crypt/Stream/Salsa20.pm index dc23ab9..e5a2555 100644 --- a/lib/Crypt/Stream/Salsa20.pm +++ b/lib/Crypt/Stream/Salsa20.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; diff --git a/lib/Crypt/Stream/Sober128.pm b/lib/Crypt/Stream/Sober128.pm index 8b8b6cc..cb838ba 100644 --- a/lib/Crypt/Stream/Sober128.pm +++ b/lib/Crypt/Stream/Sober128.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; diff --git a/lib/Crypt/Stream/Sosemanuk.pm b/lib/Crypt/Stream/Sosemanuk.pm index e68ba0e..848cce8 100644 --- a/lib/Crypt/Stream/Sosemanuk.pm +++ b/lib/Crypt/Stream/Sosemanuk.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; diff --git a/lib/CryptX.pm b/lib/CryptX.pm index 16f1808..8abe7fd 100644 --- a/lib/CryptX.pm +++ b/lib/CryptX.pm @@ -2,7 +2,7 @@ use strict; use warnings ; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use base qw(Exporter); our @EXPORT_OK = qw(); @@ -56,11 +56,12 @@ } 1; -__END__ + +=pod =head1 NAME -CryptX - Crypto toolkit (self-contained no external libraries needed) +CryptX - Cryptographic toolkit (self-contained, no external libraries needed) =head1 DESCRIPTION @@ -70,7 +71,7 @@ =over -=item * Ciphers - see L and related modules +=item * Symmetric ciphers - see L and related modules L, L, L, L, L, L, L, L, L, L, L, L, @@ -84,7 +85,7 @@ =item * Stream ciphers -L, L, L, L +L, L, L, L, L =item * Authenticated encryption modes @@ -99,9 +100,14 @@ L, L, L, L, L, L, L, L, L, L +=item * Checksums + +L, L, L + =item * Message Authentication Codes -L, L, L, L, L, L, L +L, L, L, L, L, +L, L, L, L =item * Public key cryptography @@ -111,7 +117,7 @@ L, L, L, L, L, L -=item * Key derivation functions - PBKDF1, PBKFD2 and HKDF +=item * Key derivation functions - PBKDF1, PBKDF2 and HKDF L @@ -127,4 +133,6 @@ =head1 COPYRIGHT -Copyright (c) 2013+ DCIT, a.s. L / Karel Miko \ No newline at end of file +Copyright (c) 2013+ DCIT, a.s. L / Karel Miko + +=cut diff --git a/lib/Math/BigInt/LTM.pm b/lib/Math/BigInt/LTM.pm index 9df3fcb..615a449 100644 --- a/lib/Math/BigInt/LTM.pm +++ b/lib/Math/BigInt/LTM.pm @@ -2,7 +2,7 @@ use strict; use warnings; -our $VERSION = '0.054_006'; +our $VERSION = '0.055'; use CryptX; @@ -436,8 +436,6 @@ 1; -__END__ - =pod =head1 NAME diff --git a/src/ltc/hashes/sha3.c b/src/ltc/hashes/sha3.c index fb34f25..c6faa0b 100644 --- a/src/ltc/hashes/sha3.c +++ b/src/ltc/hashes/sha3.c @@ -18,7 +18,7 @@ "sha3-224", /* name of hash */ 17, /* internal ID */ 28, /* Size of digest in octets */ - 128, /* Input block size in octets */ + 144, /* Input block size in octets */ { 2,16,840,1,101,3,4,2,7 }, /* ASN.1 OID */ 9, /* Length OID */ &sha3_224_init, @@ -33,7 +33,7 @@ "sha3-256", /* name of hash */ 18, /* internal ID */ 32, /* Size of digest in octets */ - 128, /* Input block size in octets */ + 136, /* Input block size in octets */ { 2,16,840,1,101,3,4,2,8 }, /* ASN.1 OID */ 9, /* Length OID */ &sha3_256_init, @@ -48,7 +48,7 @@ "sha3-384", /* name of hash */ 19, /* internal ID */ 48, /* Size of digest in octets */ - 128, /* Input block size in octets */ + 104, /* Input block size in octets */ { 2,16,840,1,101,3,4,2,9 }, /* ASN.1 OID */ 9, /* Length OID */ &sha3_384_init, @@ -63,7 +63,7 @@ "sha3-512", /* name of hash */ 20, /* internal ID */ 64, /* Size of digest in octets */ - 128, /* Input block size in octets */ + 72, /* Input block size in octets */ { 2,16,840,1,101,3,4,2,10 }, /* ASN.1 OID */ 9, /* Length OID */ &sha3_512_init, diff --git a/src/ltc/headers/tomcrypt.h b/src/ltc/headers/tomcrypt.h index efd00e8..9ed7750 100644 --- a/src/ltc/headers/tomcrypt.h +++ b/src/ltc/headers/tomcrypt.h @@ -30,7 +30,7 @@ #define SCRYPT "1.18.0" /* max size of either a cipher/hash block or symmetric key [largest of the two] */ -#define MAXBLOCKSIZE 128 +#define MAXBLOCKSIZE 144 /* descriptor table size */ #define TAB_SIZE 32 diff --git a/t/002_all_pm.t b/t/002_all_pm.t index 60900a3..46fa344 100644 --- a/t/002_all_pm.t +++ b/t/002_all_pm.t @@ -6,14 +6,46 @@ plan skip_all => "File::Find not installed" unless eval { require File::Find }; plan tests => 1; + +sub _read { + open my $fh, "<", shift; + binmode $fh; + return do { local $/; <$fh> }; +} + +my @err; +my $cryptx = _read("lib/CryptX.pm"); my @files; File::Find::find({ wanted=>sub { push @files, $_ if /\.pm$/ }, no_chdir=>1 }, 'lib'); for my $m (sort @files) { + my $content = _read($m); + push @err, "ERROR: no newline at the end '$m'" unless $content =~ /\n$/s; + push @err, "ERROR: avoid __END__ '$m'" if $content =~ /__END__/s; + push @err, "ERROR: =pod ... =cut '$m'" unless $content =~ /=pod\n.*?=cut\n$/s; + push @err, "ERROR: trailing whitespace '$m'" if $content =~ / \n/s; + push @err, "ERROR: avoid tabs '$m'" if $content =~ /\t/s; + push @err, "ERROR: avoid CRLF '$m'" if $content =~ /\r/s; $m =~ s|[\\/]|::|g; $m =~ s|^lib::||; $m =~ s|\.pm$||; - eval "use $m; 1;" or die "ERROR: 'use $m' failed"; + push @err, "ERROR: '$m' is missing in CryptX" unless $cryptx =~ /L<$m>/s || $m =~ /^(CryptX|Math::BigInt::LTM|Crypt::(PK|Mode|Mac|AuthEnc))$/; + eval "use $m; 1;" or push @err, "ERROR: 'use $m' failed"; } +my @others = ('CryptX.xs'); +File::Find::find({ wanted=>sub { push @others, $_ if /\.inc$/ }, no_chdir=>1 }, 'inc'); +File::Find::find({ wanted=>sub { push @others, $_ if /\.(t|pl)$/ }, no_chdir=>1 }, 't'); + +for my $m (sort @others) { + my $content = _read($m); + push @err, "ERROR: no newline at the end '$m'" unless $content =~ /\n$/s; + push @err, "ERROR: trailing whitespace '$m'" if $content =~ / \n/s; + push @err, "ERROR: avoid tabs '$m'" if $content =~ /\t/s; + push @err, "ERROR: avoid CRLF '$m'" if $content =~ /\r/s; +} + +warn "$_\n" for (@err); +die if @err; + ok 1, 'all done'; diff --git a/t/003_all_pm_pod.t b/t/003_all_pm_pod.t index a54c62f..896c284 100644 --- a/t/003_all_pm_pod.t +++ b/t/003_all_pm_pod.t @@ -3,6 +3,7 @@ use Test::More; +plan skip_all => "set TEST_POD to enable this test (developer only!)" unless $ENV{TEST_POD}; plan skip_all => "File::Find not installed" unless eval { require File::Find }; plan skip_all => "Test::Pod not installed" unless eval { require Test::Pod }; plan tests => 102; @@ -12,4 +13,4 @@ for my $m (sort @files) { Test::Pod::pod_file_ok( $m, "Valid POD in '$m'" ); -} \ No newline at end of file +} diff --git a/t/004_all_pm_pod_spelling.t b/t/004_all_pm_pod_spelling.t new file mode 100644 index 0000000..13599b2 --- /dev/null +++ b/t/004_all_pm_pod_spelling.t @@ -0,0 +1,31 @@ +use strict; +use warnings; + +use Test::More; + +plan skip_all => "set TEST_POD to enable this test (developer only!)" unless $ENV{TEST_POD}; +plan skip_all => "File::Find not installed" unless eval { require File::Find }; +plan skip_all => "Test::Pod::Spelling or Text::Aspell not installed" unless eval { require Test::Pod::Spelling; require Text::Aspell; }; + +Test::Pod::Spelling->import( + spelling => { + allow_words => [qw( + AES BLAKEb BLAKEs CPAN CRC ChaCha CryptX DCIT DER Diffie EAX ECCDH ECDH ECDSA Flickr HKDF JSON JWA JWK + Karel Miko OCB OCBv OID OMAC OO OpenSSL PBKDF PEM PKCS RIPEMD Rijndael SHA UUID RFC + decrypt decrypts interoperability cryptographically cryptographic octects + libtomcrypt libtommath + params paramshash irand perl endian zbase bumac bmac budigest bdigest md de + blakes_ blakeb_ + XOR'ing XOR'ed + )] + }, +); + +plan tests => 102; + +my @files; +File::Find::find({ wanted=>sub { push @files, $_ if /\.pm$/ }, no_chdir=>1 }, 'lib'); + +for my $m (sort @files) { + Test::Pod::Spelling::pod_file_spelling_ok( $m, "Spelling in '$m'" ); +} diff --git a/t/005_all_pm_pod_coverage.t b/t/005_all_pm_pod_coverage.t new file mode 100644 index 0000000..1d03d52 --- /dev/null +++ b/t/005_all_pm_pod_coverage.t @@ -0,0 +1,47 @@ +use strict; +use warnings; + +use Test::More; + +plan skip_all => "set TEST_POD to enable this test (developer only!)" unless $ENV{TEST_POD}; +plan skip_all => "Pod::Coverage not installed" unless eval { require Pod::Coverage }; +plan skip_all => "File::Find not installed" unless eval { require File::Find }; +plan tests => 102; + +my @files; +File::Find::find({ wanted=>sub { push @files, $_ if /\.pm$/ }, no_chdir=>1 }, 'lib'); + +my @err; +for my $m (sort @files) { + my $f = $m; + $m =~ s|[\\/]|::|g; + $m =~ s|^lib::||; + $m =~ s|\.pm$||; + + my $pc; + if ($m eq 'Crypt::PK::DH') { + $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(decrypt|dh_decrypt|dh_encrypt|dh_sign_hash|dh_sign_message|dh_verify_hash|dh_verify_message|encrypt|sign_hash|sign_message|verify_hash|verify_message)$/] ); + } + elsif ($m eq 'Math::BigInt::LTM') { + $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(STORABLE_thaw|STORABLE_freeze|api_version)$/] ); + } + elsif ($m eq 'Crypt::Mode') { + $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(add|decrypt|encrypt|finish|new|start_decrypt|start_encrypt)$/] ); + } + elsif ($m eq 'Crypt::Mac') { + $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(add|addfile)$/] ); + } + elsif ($m eq 'Crypt::AuthEnc::OCB') { + $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(blocksize|aad_add)$/] ); + } + elsif ($m eq 'Crypt::AuthEnc::EAX') { + $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(header_add|aad_add)$/] ); + } + else { + $pc = Pod::Coverage->new(package => $m, pod_from => $f); + } + + my $c = $pc->coverage || 0; + my @u = $pc->uncovered; + ok(@u == 0, sprintf("$m score=%.2f naked=(" . join(" ", @u) . ")", $c)); +} diff --git a/t/auth_enc_ccm.t b/t/auth_enc_ccm.t index 6946cc8..fc8a727 100644 --- a/t/auth_enc_ccm.t +++ b/t/auth_enc_ccm.t @@ -50,4 +50,4 @@ is(unpack('H*', $tag), "9e9cba5dd4939d0d8e2687c85c5d3b89", "ccm_encrypt_authenticate: tag (no header)"); my $pt = ccm_decrypt_verify('AES', $key, $nonce, "", $ct, $tag); is($pt, "plain_halfplain_half", "ccm_decrypt_verify: plaintext (no header)"); -} \ No newline at end of file +} diff --git a/t/auth_enc_ccm_test_vector_ltc.t b/t/auth_enc_ccm_test_vector_ltc.t index eeb80c3..96ba863 100644 --- a/t/auth_enc_ccm_test_vector_ltc.t +++ b/t/auth_enc_ccm_test_vector_ltc.t @@ -7,14 +7,14 @@ sub do_test { my %a = @_; - - my $key = pack("H*", $a{key}); + + my $key = pack("H*", $a{key}); my $nonce = pack("H*", $a{nonce}); my $header = pack("H*", $a{header}); my $plaintext = pack("H*", $a{plaintext}); my $ciphertext = pack("H*", $a{ciphertext}); my $tag = pack("H*", $a{tag}); - + my ($ct3, $tag3) = ccm_encrypt_authenticate('AES', $key, $nonce, $header, length($tag), $plaintext); is(unpack('H*', $ct3), $a{ciphertext}, "enc: ciphertext"); is(unpack('H*', $tag3), $a{tag}, "enc: tag"); @@ -33,7 +33,7 @@ ciphertext=>'588c979a61c663d2f066d0c2c0f989806d5f6b61dac384', tag=>'17e8d12cfdf926e0', }, - + #/* 13 byte nonce, 12 byte header, 19 byte pt */ { key=>'c0c1c2c3c4c5c6c7c8c9cacbcccdcecf', @@ -43,7 +43,7 @@ ciphertext=>'a28c6865939a9a79faaa5c4c2a9d4a91cdac8c', tag=>'96c861b9c9e61ef1', }, - + #/* supplied by Brian Gladman */ { key=>'404142434445464748494a4b4c4d4e4f', @@ -53,7 +53,7 @@ ciphertext=>'7162015b', tag=>'4dac255d', }, - + { key=>'c97c1f67ce371185514a8a19f2bdd52f', nonce=>'005030f1844408b5039776e70c', @@ -62,4 +62,4 @@ ciphertext=>'f3d0a2fe9a3dbf2342a643e43246e80c3c04d019', tag=>'7845ce0b16f97623', }, -); +); diff --git a/t/auth_enc_eax_test_vector_ltc.t b/t/auth_enc_eax_test_vector_ltc.t index f196234..922b9c5 100644 --- a/t/auth_enc_eax_test_vector_ltc.t +++ b/t/auth_enc_eax_test_vector_ltc.t @@ -7,14 +7,14 @@ sub do_test { my %a = @_; - - my $key = pack("H*", $a{key}); + + my $key = pack("H*", $a{key}); my $nonce = pack("H*", $a{nonce}); my $header = pack("H*", $a{header}); my $plaintext = pack("H*", $a{plaintext}); my $ciphertext = pack("H*", $a{ciphertext}); my $tag = pack("H*", $a{tag}); - + # encrypt my $m1 = Crypt::AuthEnc::EAX->new("AES", $key, $nonce); $m1->header_add($header); @@ -39,7 +39,7 @@ is(unpack('H*', $tag3), $a{tag}, "enc: tag"); my $pt3 = eax_decrypt_verify('AES', $key, $nonce, $header, $ciphertext, $tag); is(unpack('H*', $pt3), $a{plaintext}, "dec: plaintext"); - + } do_test(%$_) for ( @@ -77,7 +77,7 @@ { #16, 16, 16, 32, key => '000102030405060708090a0b0c0d0e0f', - nonce => '000102030405060708090a0b0c0d0e0f', + nonce => '000102030405060708090a0b0c0d0e0f', header => '000102030405060708090a0b0c0d0e0f', plaintext => '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f', ciphertext => '29d878d1a3be857b6fb8c8ea5950a778331fbf2ccf33986f35e8cf121dcb30bc', @@ -87,13 +87,13 @@ { #16, 15, 14, 29, key => '000102030405060708090a0b0c0d0e0f', - nonce => '000102030405060708090a0b0c0d0e', + nonce => '000102030405060708090a0b0c0d0e', header => '000102030405060708090a0b0c0d', plaintext => '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c', ciphertext => 'dd25c754c5b17c5928b69b73155f7bb8888faf37091ad92c8a24db868b', tag => '0d1a14e52224ffd23a05fa02cdef52da', }, - + #/* Vectors from Brian Gladman */ { #16, 16, 8, 0, @@ -122,4 +122,4 @@ ciphertext => 'd851d5bae0', tag => '3a59f238a23e39199dc9266626c40f80', }, -); +); diff --git a/t/auth_enc_gcm_test_vector_ltc.t b/t/auth_enc_gcm_test_vector_ltc.t index 6afbaab..901698d 100644 --- a/t/auth_enc_gcm_test_vector_ltc.t +++ b/t/auth_enc_gcm_test_vector_ltc.t @@ -7,14 +7,14 @@ sub do_test { my %a = @_; - - my $key = pack("H*", $a{key}); + + my $key = pack("H*", $a{key}); my $adata = pack("H*", $a{adata}); my $iv = pack("H*", $a{iv}); my $plaintext = pack("H*", $a{plaintext}); my $ciphertext = pack("H*", $a{ciphertext}); my $tag = pack("H*", $a{tag}); - + # encrypt my $m1 = Crypt::AuthEnc::GCM->new("AES", $key); $m1->iv_add($iv); @@ -41,7 +41,7 @@ is(unpack('H*', $tag3), $a{tag}, "enc: tag"); my $pt3 = gcm_decrypt_verify('AES', $key, $iv, $adata, $ciphertext, $tag); is(unpack('H*', $pt3), $a{plaintext}, "dec: plaintext"); - + } do_test(%$_) for ( @@ -55,7 +55,7 @@ # ciphertext => '', # tag => '58e2fccefa7e3061367f1d57a4e7455a', # }, - + #/* test case #2 */ { key => '00000000000000000000000000000000', @@ -65,7 +65,7 @@ ciphertext => '0388dace60b6a392f328c2b971b2fe78', tag => 'ab6e47d42cec13bdf53a67b21257bddf', }, - + #/* test case #3 */ { key => 'feffe9928665731c6d6a8f9467308308', @@ -75,7 +75,7 @@ ciphertext => '42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985', tag => '4d5c2af327cd64a62cf35abd2ba6fab4', }, - + #/* test case #4 */ { key => 'feffe9928665731c6d6a8f9467308308', @@ -85,7 +85,7 @@ ciphertext => '42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091', tag => '5bc94fbc3221a5db94fae95ae7121a47', }, - + #/* test case #5 */ { key => 'feffe9928665731c6d6a8f9467308308', @@ -95,7 +95,7 @@ ciphertext => '61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c742373806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f4598', tag => '3612d2e79e3b0785561be14aaca2fccb', }, - + #/* test case #6 */ { key => 'feffe9928665731c6d6a8f9467308308', @@ -105,7 +105,7 @@ ciphertext => '8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca701e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5', tag => '619cc5aefffe0bfa462af43c1699d050', }, - + #/* test case #46 from BG (catches the LTC bug of v1.15) */ { key => '00000000000000000000000000000000', @@ -115,4 +115,4 @@ ciphertext => 'cbc8d2f15481a4cc7dd1e19aaa83de5678483ec359ae7dec2ab8d534e0906f4b4663faff58a8b2d733b845eef7c9b331e9e10eb2612c995feb1ac15a6286cce8b297a8', tag => '8d2d2a9372626f6bee8580276a6366bf', } -); +); diff --git a/t/auth_enc_ocb_test_vectors_ietf.t b/t/auth_enc_ocb_test_vectors_ietf.t index 8a25a12..8e29a2c 100644 --- a/t/auth_enc_ocb_test_vectors_ietf.t +++ b/t/auth_enc_ocb_test_vectors_ietf.t @@ -12,7 +12,7 @@ chomp($l); next if $l =~ /^#/; $l =~ s/[\s\t]+/ /g; - + if ($l eq '') { next unless defined $d->{C}; my $A = pack('H*', $d->{A}); @@ -21,7 +21,7 @@ my $K = pack('H*', $d->{K}); my $N = pack('H*', $d->{N}); my $tag_len = $d->{T} * 1; - + { #ENCRYPT my $m = Crypt::AuthEnc::OCB->new('AES', $K, $N, $tag_len); $m->adata_add($A); @@ -48,7 +48,7 @@ $v =~ s/\s//g; $d->{$k} = $v; } - + } #print $text; @@ -173,4 +173,4 @@ P: 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627 C: 1792A4E31E0755FB03E31B22116E6C2DDF9EFD6E33D536F1A0124B0A55BAE884ED93481529C76B6AD0C515F4D1CDD4FDAC4F02AA -LAST_ITEM_PLACEHOLDER_DO_NOT_DELETE!!! \ No newline at end of file +LAST_ITEM_PLACEHOLDER_DO_NOT_DELETE!!! diff --git a/t/cipher_aes_test_vectors_bc.t b/t/cipher_aes_test_vectors_bc.t index fac267c..0fff828 100644 --- a/t/cipher_aes_test_vectors_bc.t +++ b/t/cipher_aes_test_vectors_bc.t @@ -15,7 +15,7 @@ my ($k, $v) = split /:/, $pair; $d->{$k} = $v; } - + my $c = Crypt::Cipher::AES->new(pack('H*',$d->{key})); my $result = pack('H*', $d->{pt}); $result = $c->encrypt($result) for(1..$d->{iter}); diff --git a/t/cipher_seed_test_vectors_bc.t b/t/cipher_seed_test_vectors_bc.t index a0b28f1..5093e1c 100644 --- a/t/cipher_seed_test_vectors_bc.t +++ b/t/cipher_seed_test_vectors_bc.t @@ -13,7 +13,7 @@ my ($k, $v) = split /:/, $pair; $d->{$k} = $v; } - + my $c = Crypt::Cipher::SEED->new(pack('H*',$d->{key})); my $result = pack('H*', $d->{pt}); $result = $c->encrypt($result) for(1..$d->{iter}); diff --git a/t/cipher_serpent_compat.t b/t/cipher_serpent_compat.t index 5ba15f9..786cf8f 100644 --- a/t/cipher_serpent_compat.t +++ b/t/cipher_serpent_compat.t @@ -26,4 +26,4 @@ key=000000000000000000000000000000004000000000000000 ptext=00000000000000000000000000000000 ctext=53bd3e8475db67f72910b945bf8c768e key=000000000000000000000000000000010000000000000000 ptext=00000000000000000000000000000000 ctext=deab7388a6f1c61d41e25a0d88f062c4 key=0000000000000000000000800000000000000000000000000000000000000000 ptext=00000000000000000000000000000000 ctext=ad4b018d50e3a28124a0a1259dc667d4 -key=4000000000000000000000000000000000000000000000000000000000000000 ptext=00000000000000000000000000000000 ctext=eae1d405570174df7df2f9966d509159 \ No newline at end of file +key=4000000000000000000000000000000000000000000000000000000000000000 ptext=00000000000000000000000000000000 ctext=eae1d405570174df7df2f9966d509159 diff --git a/t/cipher_test_vectors_ltc.t b/t/cipher_test_vectors_ltc.t index 3658176..09943a0 100644 --- a/t/cipher_test_vectors_ltc.t +++ b/t/cipher_test_vectors_ltc.t @@ -32,7 +32,7 @@ my $size; while (my $l = ) { - $l =~ s/[\r\n]*$//; + $l =~ s/[\r\n]*$//; $l =~ s/^[\s]*([^\s\r\n]+).*?/$1/; $l =~ s/\s+//g; my ($k, $v) = split /:/, $l; @@ -58,7 +58,7 @@ next unless $tv->{$n}->{$ks}->{$i}; my $ct = Crypt::Cipher->new($N, $key)->encrypt($bytes); is(unpack('H*', $ct), lc($tv->{$n}->{$ks}->{$i}), "$N/$ks/$i"); - $bytes = $ct; + $bytes = $ct; $key = substr($ct x 100, 0, $ks); } } diff --git a/t/cipher_test_vectors_openssl.t b/t/cipher_test_vectors_openssl.t index aa2d95a..ccd752c 100644 --- a/t/cipher_test_vectors_openssl.t +++ b/t/cipher_test_vectors_openssl.t @@ -12,7 +12,7 @@ use Crypt::Cipher; while (my $l = ) { - $l =~ s/[\r\n]*$//; + $l =~ s/[\r\n]*$//; $l =~ s/^\s*([^\s\r\n]+).*?/$1/; $l =~ s/\s+//; next if !$l || $l =~ /^#/; @@ -63,7 +63,7 @@ die "UNKNOWN MODE '$mode'"; } #warn "[$cipher|$mode, ".length($key).", ".length($iv).", ".length($pt).", ".length($ct).", ".length($flag)."]\n"; -} +} __DATA__ #cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt) @@ -120,29 +120,29 @@ AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:F5D3D58503B9699DE785895A96FDBAAF AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:43B1CD7F598ECE23881B00E3ED030688 AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:7B0C785E27E8AD3F8223207104725DD4 -# ECB-AES192.Encrypt and ECB-AES192.Decrypt +# ECB-AES192.Encrypt and ECB-AES192.Decrypt AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:BD334F1D6E45F25FF712A214571FA5CC AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:974104846D0AD3AD7734ECB3ECEE4EEF AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:EF7AFD2270E2E60ADCE0BA2FACE6444E AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:9A4B41BA738D6C72FB16691603C18E0E -# ECB-AES256.Encrypt and ECB-AES256.Decrypt +# ECB-AES256.Encrypt and ECB-AES256.Decrypt AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:F3EED1BDB5D2A03C064B5A7E3DB181F8 AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:591CCB10D410ED26DC5BA74A31362870 AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:B6ED21B99CA6F4F9F153E7B1BEAFED1D AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:23304B7A39F9F3FF067D8D8F9E24ECC7 # For all CBC encrypts and decrypts, the transformed sequence is # AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec -# CBC-AES128.Encrypt and CBC-AES128.Decrypt +# CBC-AES128.Encrypt and CBC-AES128.Decrypt AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2 AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516 AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7 -# CBC-AES192.Encrypt and CBC-AES192.Decrypt +# CBC-AES192.Encrypt and CBC-AES192.Decrypt AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8 AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0 AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD -# CBC-AES256.Encrypt and CBC-AES256.Decrypt +# CBC-AES256.Encrypt and CBC-AES256.Decrypt AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6 AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461 @@ -150,12 +150,12 @@ # We don't support CFB{1,8}-AESxxx.{En,De}crypt # For all CFB128 encrypts and decrypts, the transformed sequence is # AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec -# CFB128-AES128.Encrypt +# CFB128-AES128.Encrypt AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1 -# CFB128-AES128.Decrypt +# CFB128-AES128.Decrypt AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0 @@ -170,44 +170,44 @@ AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0 AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0 AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0 -# CFB128-AES256.Encrypt +# CFB128-AES256.Encrypt AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1 -# CFB128-AES256.Decrypt +# CFB128-AES256.Decrypt AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0 # For all OFB encrypts and decrypts, the transformed sequence is # AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec -# OFB-AES128.Encrypt -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 -# OFB-AES128.Decrypt +# OFB-AES128.Encrypt +AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 +AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 +AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 +AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 +# OFB-AES128.Decrypt AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0 -# OFB-AES192.Encrypt -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 -# OFB-AES192.Decrypt -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 -# OFB-AES256.Encrypt +# OFB-AES192.Encrypt +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 +# OFB-AES192.Decrypt +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 +# OFB-AES256.Encrypt AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1 -# OFB-AES256.Decrypt +# OFB-AES256.Decrypt AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 @@ -263,19 +263,19 @@ CAMELLIA-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:B22F3C36B72D31329EEE8ADDC2906C68:1 CAMELLIA-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:2EDF1F3418D53B88841FC8985FB1ECF2:1 -# ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt +# ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:432FC5DCD628115B7C388D770B270C96 CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:0BE1F14023782A22E8384C5ABB7FAB2B CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:A0A1ABCD1893AB6FE0FE5B65DF5F8636 CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:E61925E0D5DFAA9BB29F815B3076E51A -# ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt +# ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:CCCC6C4E138B45848514D48D0D3439D3 CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:5713C62C14B2EC0F8393B6AFD6F5785A CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:B40ED2B60EB54D09D030CF511FEEF366 CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:909DBD95799096748CB27357E73E1D26 -# ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt +# ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:BEFD219B112FA00098919CD101C9CCFA CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:C91D3A8F1AEA08A9386CF4B66C0169EA CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:A623D711DC5F25A51BB8A80D56397D28 @@ -283,19 +283,19 @@ # For all CBC encrypts and decrypts, the transformed sequence is # CAMELLIA-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec -# CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt +# CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:1607CF494B36BBF00DAEB0B503C831AB CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:1607CF494B36BBF00DAEB0B503C831AB:AE2D8A571E03AC9C9EB76FAC45AF8E51:A2F2CF671629EF7840C5A5DFB5074887 CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:A2F2CF671629EF7840C5A5DFB5074887:30C81C46A35CE411E5FBC1191A0A52EF:0F06165008CF8B8B5A63586362543E54 CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:36A84CDAFD5F9A85ADA0F0A993D6D577:F69F2445DF4F9B17AD2B417BE66C3710:74C64268CDB8B8FAF5B34E8AF3732980 -# CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt +# CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:2A4830AB5AC4A1A2405955FD2195CF93 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2A4830AB5AC4A1A2405955FD2195CF93:AE2D8A571E03AC9C9EB76FAC45AF8E51:5D5A869BD14CE54264F892A6DD2EC3D5 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:5D5A869BD14CE54264F892A6DD2EC3D5:30C81C46A35CE411E5FBC1191A0A52EF:37D359C3349836D884E310ADDF68C449 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:37D359C3349836D884E310ADDF68C449:F69F2445DF4F9B17AD2B417BE66C3710:01FAAA930B4AB9916E9668E1428C6B08 -# CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt +# CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:E6CFA35FC02B134A4D2C0B6737AC3EDA CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E6CFA35FC02B134A4D2C0B6737AC3EDA:AE2D8A571E03AC9C9EB76FAC45AF8E51:36CBEB73BD504B4070B1B7DE2B21EB50 CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:36CBEB73BD504B4070B1B7DE2B21EB50:30C81C46A35CE411E5FBC1191A0A52EF:E31A6055297D96CA3330CDF1B1860A83 @@ -304,13 +304,13 @@ # We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt # For all CFB128 encrypts and decrypts, the transformed sequence is # CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec -# CFB128-CAMELLIA128.Encrypt +# CFB128-CAMELLIA128.Encrypt CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:1 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:1 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:1 -# CFB128-CAMELLIA128.Decrypt +# CFB128-CAMELLIA128.Decrypt CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:0 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:0 @@ -328,13 +328,13 @@ CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:0 CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:0 -# CFB128-CAMELLIA256.Encrypt +# CFB128-CAMELLIA256.Encrypt CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:1 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:1 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:1 -# CFB128-CAMELLIA256.Decrypt +# CFB128-CAMELLIA256.Decrypt CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:0 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:0 @@ -342,37 +342,37 @@ # For all OFB encrypts and decrypts, the transformed sequence is # CAMELLIA-bits-OFB:key:IV/output':plaintext:ciphertext:encdec -# OFB-CAMELLIA128.Encrypt +# OFB-CAMELLIA128.Encrypt CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:1 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:1 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:1 -# OFB-CAMELLIA128.Decrypt +# OFB-CAMELLIA128.Decrypt CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:0 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:0 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:0 -# OFB-CAMELLIA192.Encrypt +# OFB-CAMELLIA192.Encrypt CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:1 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:1 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:1 -# OFB-CAMELLIA192.Decrypt +# OFB-CAMELLIA192.Decrypt CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:0 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:0 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:0 -# OFB-CAMELLIA256.Encrypt +# OFB-CAMELLIA256.Encrypt CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:1 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:1 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:1 -# OFB-CAMELLIA256.Decrypt +# OFB-CAMELLIA256.Decrypt CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:0 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:0 @@ -386,4 +386,4 @@ SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:1 SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:1 SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:1 -SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:1 \ No newline at end of file +SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:1 diff --git a/t/cipher_twofish_test_vectors_bc.t b/t/cipher_twofish_test_vectors_bc.t index 11f616a..ce4fdff 100644 --- a/t/cipher_twofish_test_vectors_bc.t +++ b/t/cipher_twofish_test_vectors_bc.t @@ -13,7 +13,7 @@ my ($k, $v) = split /:/, $pair; $d->{$k} = $v; } - + my $c = Crypt::Cipher::Twofish->new(pack('H*',$d->{key})); my $result = pack('H*', $d->{pt}); $result = $c->encrypt($result) for(1..$d->{iter}); diff --git a/t/cipher_xtea_test_vectors_bc.t b/t/cipher_xtea_test_vectors_bc.t index 4a4dbb8..9304920 100644 --- a/t/cipher_xtea_test_vectors_bc.t +++ b/t/cipher_xtea_test_vectors_bc.t @@ -13,7 +13,7 @@ my ($k, $v) = split /:/, $pair; $d->{$k} = $v; } - + my $c = Crypt::Cipher::XTEA->new(pack('H*',$d->{key})); my $result = pack('H*', $d->{pt}); $result = $c->encrypt($result) for(1..$d->{iter}); diff --git a/t/crypt-misc.t b/t/crypt-misc.t index 46fe739..9cd323d 100644 --- a/t/crypt-misc.t +++ b/t/crypt-misc.t @@ -142,4 +142,4 @@ is(unpack("H*", decode_b32b(encode_b32b($b))), $h); is(unpack("H*", decode_b32z(encode_b32z($b))), $h); is(unpack("H*", decode_b32c(encode_b32c($b))), $h); -} \ No newline at end of file +} diff --git a/t/digest_test_vectors_ltc.t b/t/digest_test_vectors_ltc.t index da12c44..1b90f37 100644 --- a/t/digest_test_vectors_ltc.t +++ b/t/digest_test_vectors_ltc.t @@ -23,7 +23,7 @@ my $hash; while (my $l = ) { - $l =~ s/[\r\n]*$//; + $l =~ s/[\r\n]*$//; $l =~ s/^[\s]*([^\s\r\n]+).*?/$1/; $l =~ s/\s+//; my ($k, $v) = split /:/, $l; diff --git a/t/key_derivation.t b/t/key_derivation.t index 48a2564..88a96d6 100644 --- a/t/key_derivation.t +++ b/t/key_derivation.t @@ -13,7 +13,7 @@ my $expected_prk = "077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e5"; my $expected_okm = "3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865"; - my $prk = hkdf_extract($keying_material, $salt, $hash_name); + my $prk = hkdf_extract($keying_material, $salt, $hash_name); my $okm1 = hkdf_expand($prk, $hash_name, $len, $info); my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info); is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/1"); @@ -30,7 +30,7 @@ my $expected_prk = "06a6b88c5853361a06104c9ceb35b45cef760014904671014a193f40c15fc244"; my $expected_okm = "b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87"; - my $prk = hkdf_extract($keying_material, $salt, $hash_name); + my $prk = hkdf_extract($keying_material, $salt, $hash_name); my $okm1 = hkdf_expand($prk, $hash_name, $len, $info); my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info); is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/2"); @@ -47,7 +47,7 @@ my $expected_prk = "19ef24a32c717b167f33a91d6f648bdf96596776afdb6377ac434c1c293ccb04"; my $expected_okm = "8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8"; - my $prk = hkdf_extract($keying_material, $salt, $hash_name); + my $prk = hkdf_extract($keying_material, $salt, $hash_name); my $okm1 = hkdf_expand($prk, $hash_name, $len, $info); my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info); is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/3"); @@ -64,7 +64,7 @@ my $expected_prk = "9b6c18c432a7bf8f0e71c8eb88f4b30baa2ba243"; my $expected_okm = "085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f155fda2c22e422478d305f3f896"; - my $prk = hkdf_extract($keying_material, $salt, $hash_name); + my $prk = hkdf_extract($keying_material, $salt, $hash_name); my $okm1 = hkdf_expand($prk, $hash_name, $len, $info); my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info); is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/4"); @@ -81,7 +81,7 @@ my $expected_prk = "8adae09a2a307059478d309b26c4115a224cfaf6"; my $expected_okm = "0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4"; - my $prk = hkdf_extract($keying_material, $salt, $hash_name); + my $prk = hkdf_extract($keying_material, $salt, $hash_name); my $okm1 = hkdf_expand($prk, $hash_name, $len, $info); my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info); is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/5"); @@ -98,7 +98,7 @@ my $expected_prk = "da8c8a73c7fa77288ec6f5e7c297786aa0d32d01"; my $expected_okm = "0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0ea00033de03984d34918"; - my $prk = hkdf_extract($keying_material, $salt, $hash_name); + my $prk = hkdf_extract($keying_material, $salt, $hash_name); my $okm1 = hkdf_expand($prk, $hash_name, $len, $info); my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info); is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/6"); @@ -115,7 +115,7 @@ my $expected_prk = "2adccada18779e7c2077ad2eb19d3f3e731385dd"; my $expected_okm = "2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5673a081d70cce7acfc48"; - my $prk = hkdf_extract($keying_material, $salt, $hash_name); + my $prk = hkdf_extract($keying_material, $salt, $hash_name); my $okm1 = hkdf_expand($prk, $hash_name, $len, $info); my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info); is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/7"); diff --git a/t/mac_hmac_nist.t b/t/mac_hmac_nist.t new file mode 100644 index 0000000..5acb93f --- /dev/null +++ b/t/mac_hmac_nist.t @@ -0,0 +1,206 @@ +use strict; +use warnings; + +use Test::More tests => 36; + +use Crypt::Mac::HMAC 'hmac_hex'; + +# test vectors from https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/example-values#aMsgAuth + +# https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA3-224.pdf +{ + my $input = "Sample message for keylen) { - $l =~ s/[\r\n]*$//; + $l =~ s/[\r\n]*$//; $l =~ s/^[\s]*([^\s\r\n]+).*?/$1/; $l =~ s/\s+//; if ($l=~/^HMAC-([^\n\r]+)/) { @@ -42,13 +42,13 @@ for my $n (sort keys %$tv) { my $N = $trans->{$n} || die "FATAL: unknown name '$n'"; - my $key = substr($seq, 0, Crypt::Digest->hashsize($N)); + my $key = substr($seq, 0, Crypt::Digest->hashsize($N)); for my $i (0..255) { my $bytes = substr($seq, 0, $i); next unless $tv->{$n}->{$i}; my $result = Crypt::Mac::HMAC->new($N, $key)->add($bytes)->mac; is(unpack('H*', $result), lc($tv->{$n}->{$i}), "$N/$i"); - $bytes = $result; + $bytes = $result; $key = substr($result x 100, 0, Crypt::Digest->hashsize($N)); } } diff --git a/t/mac_omac_test_vectors_ltc.t b/t/mac_omac_test_vectors_ltc.t index 8576d8e..92e8833 100644 --- a/t/mac_omac_test_vectors_ltc.t +++ b/t/mac_omac_test_vectors_ltc.t @@ -32,7 +32,7 @@ my $ks; while (my $l = ) { - $l =~ s/[\r\n]*$//; + $l =~ s/[\r\n]*$//; $l =~ s/^[\s]*([^\s\r\n]+).*?/$1/; $l =~ s/\s+//; if ($l=~/^OMAC-([a-z0-9\+\-]+).*?(\d+)/i) { @@ -52,13 +52,13 @@ for my $n (sort keys %$tv) { for my $ks (sort keys %{$tv->{$n}}) { my $N = $trans->{$n} || die "FATAL: unknown name '$n'"; - my $key = substr($seq, 0, $ks); + my $key = substr($seq, 0, $ks); for my $i (0..255) { my $bytes = substr($seq, 0, $i); next unless $tv->{$n}->{$ks}->{$i}; my $result = Crypt::Mac::OMAC->new($N, $key)->add($bytes)->mac; is(unpack('H*', $result), lc($tv->{$n}->{$ks}->{$i}), "$N/$i"); - $bytes = $result; + $bytes = $result; $key = substr($result x 100, 0, $ks); } } diff --git a/t/mac_pmac_test_vectors_ltc.t b/t/mac_pmac_test_vectors_ltc.t index c892a93..4b8d225 100644 --- a/t/mac_pmac_test_vectors_ltc.t +++ b/t/mac_pmac_test_vectors_ltc.t @@ -32,7 +32,7 @@ my $ks; while (my $l = ) { - $l =~ s/[\r\n]*$//; + $l =~ s/[\r\n]*$//; $l =~ s/^[\s]*([^\s\r\n]+).*?/$1/; $l =~ s/\s+//; if ($l=~/^PMAC-([a-z0-9\+\-]+).*?(\d+)/i) { @@ -52,13 +52,13 @@ for my $n (sort keys %$tv) { for my $ks (sort keys %{$tv->{$n}}) { my $N = $trans->{$n} || die "FATAL: unknown name '$n'"; - my $key = substr($seq, 0, $ks); + my $key = substr($seq, 0, $ks); for my $i (0..255) { my $bytes = substr($seq, 0, $i); next unless $tv->{$n}->{$ks}->{$i}; my $result = Crypt::Mac::PMAC->new($N, $key)->add($bytes)->mac; is(unpack('H*', $result), lc($tv->{$n}->{$ks}->{$i}), "$N/$i"); - $bytes = $result; + $bytes = $result; $key = substr($result x 100, 0, $ks); } } diff --git a/t/mbi_ltm_01load.t b/t/mbi_ltm_01load.t index f4fccb4..c974521 100644 --- a/t/mbi_ltm_01load.t +++ b/t/mbi_ltm_01load.t @@ -10,4 +10,4 @@ use_ok('Math::BigInt'); # Math::BigInt is required for the tests }; -diag "Math::BigInt VERSION=$Math::BigInt::VERSION\n"; \ No newline at end of file +diag "Math::BigInt VERSION=$Math::BigInt::VERSION\n"; diff --git a/t/mbi_ltm_bigfltpm.t b/t/mbi_ltm_bigfltpm.t index f63c98c..3540868 100644 --- a/t/mbi_ltm_bigfltpm.t +++ b/t/mbi_ltm_bigfltpm.t @@ -38,4 +38,4 @@ is(ref($e->{_e}->[0]), '', '$e->{_e}->[0] is a scalar'); } -require './t/mbi_ltm/bigfltpm.inc'; # all tests here for sharing +require './t/mbi_ltm/bigfltpm.inc'; # all tests here for sharing diff --git a/t/mbi_ltm_biglog.t b/t/mbi_ltm_biglog.t index f4ea0ab..34ea355 100644 --- a/t/mbi_ltm_biglog.t +++ b/t/mbi_ltm_biglog.t @@ -110,11 +110,11 @@ is ($cl->new('20')->blog(20,10), '1.000000000'); is ($cl->new('100')->blog(100,10), '1.000000000'); -is ($cl->new('100')->blog(10,10), '2.000000000'); # 10 ** 2 == 100 -is ($cl->new('400')->blog(20,10), '2.000000000'); # 20 ** 2 == 400 +is ($cl->new('100')->blog(10,10), '2.000000000'); # 10 ** 2 == 100 +is ($cl->new('400')->blog(20,10), '2.000000000'); # 20 ** 2 == 400 -is ($cl->new('4')->blog(2,10), '2.000000000'); # 2 ** 2 == 4 -is ($cl->new('16')->blog(2,10), '4.000000000'); # 2 ** 4 == 16 +is ($cl->new('4')->blog(2,10), '2.000000000'); # 2 ** 2 == 4 +is ($cl->new('16')->blog(2,10), '4.000000000'); # 2 ** 4 == 16 is ($cl->new('1.2')->bpow('0.3',10), '1.056219968'); is ($cl->new('10')->bpow('0.6',10), '3.981071706'); @@ -165,19 +165,19 @@ # test bexp() with cached results is ($cl->new(1)->bexp(), '2.718281828459045235360287471352662497757', 'bexp(1)'); -is ($cl->new(2)->bexp(40), $cl->new(1)->bexp(45)->bpow(2,40), 'bexp(2)'); +is ($cl->new(2)->bexp(40), $cl->new(1)->bexp(45)->bpow(2,40), 'bexp(2)'); -is ($cl->new("12.5")->bexp(61), $cl->new(1)->bexp(65)->bpow(12.5,61), 'bexp(12.5)'); +is ($cl->new("12.5")->bexp(61), $cl->new(1)->bexp(65)->bpow(12.5,61), 'bexp(12.5)'); ############################################################################# # test bexp() with big values (non-cached) -is ($cl->new(1)->bexp(100), +is ($cl->new(1)->bexp(100), '2.718281828459045235360287471352662497757247093699959574966967627724076630353547594571382178525166427', 'bexp(100)'); -is ($cl->new("12.5")->bexp(91), $cl->new(1)->bexp(95)->bpow(12.5,91), - 'bexp(12.5) to 91 digits'); +is ($cl->new("12.5")->bexp(91), $cl->new(1)->bexp(95)->bpow(12.5,91), + 'bexp(12.5) to 91 digits'); # all done 1; @@ -190,5 +190,3 @@ print "# Tried: $x->bpow($y,$scale);\n" unless ok ($cl->new($x)->bpow($y,$scale),$result); } - - diff --git a/t/mbi_ltm_bigroot.t b/t/mbi_ltm_bigroot.t index 2eac4b0..f9d11df 100644 --- a/t/mbi_ltm_bigroot.t +++ b/t/mbi_ltm_bigroot.t @@ -24,7 +24,7 @@ my $cl = "Math::BigFloat"; my $c = "Math::BigInt"; -# 2 ** 240 = +# 2 ** 240 = # 1766847064778384329583297500742918515827483896875618958121606201292619776 # takes way too long @@ -47,4 +47,3 @@ $result =~ s/\..*//; is ($c->new($x)->bpow($n)->broot($y,$scale),$result, "Try: $c $x->bpow($n)->broot($y,$s) == $result"); } - diff --git a/t/mode_cbc.t b/t/mode_cbc.t index 09a41db..0499251 100644 --- a/t/mode_cbc.t +++ b/t/mode_cbc.t @@ -6,14 +6,14 @@ my @tests; # test vectors from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf -push @tests, +push @tests, { padding=>'none', key=>'2b7e151628aed2a6abf7158809cf4f3c', iv=>'000102030405060708090a0b0c0d0e0f', pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', ct=>'7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a7' }, { padding=>'none', key=>'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b', iv=>'000102030405060708090a0b0c0d0e0f', pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', ct=>'4f021db243bc633d7178183a9fa071e8b4d9ada9ad7dedf4e5e738763f69145a571b242012fb7ae07fa9baac3df102e008b0e27988598881d920a9e64f5615cd' }, { padding=>'none', key=>'603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', iv=>'000102030405060708090a0b0c0d0e0f', pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', ct=>'f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461b2eb05e2c39be9fcda6c19078c6a9d1b' }, -; +; # test vectors produced by Crypt::CBC -push @tests, +push @tests, { mode=>'AES+Crypt::CBC', padding=>'standard', len=>45, key=>'4cdc909dc310796429e26bcaca1b21329f5060813b7d17bf1a65f293154b54a9', iv=>'9124d8cfafd3d732e597f463d35a8a43', pt=>'ad67301bcd23a5d7b4601f93db3e6b5db71243fa00244182d0a2df6f0384a09f117821b7b70a4bcdc0a73a70130851f704a7aca59b96a3e5b8dc89efa7ee7846a906a3eb591bf8b6b472ae07113ac3cccfb1bc84723ed1472c1f59705eae7b9fbd6df2b38d2eac2a6c726b9f92', ct=>'588c33d96d99477bc6305c829a1fb188ab165f60ccadac67daaefb8054cfe8093cbb6fba14b684c26cd10c66db87cf1aa8cd69c98180d1d7cb6edc9191332863653ea707cb9ec4da0c7d4381cac33faa938a53df3519d06859260be7ac582674cdedfa411f4cd0204c8b2132d4b100cc' }, { mode=>'AES+Crypt::CBC', padding=>'standard', len=>46, key=>'0c1afd6567e265240aacef873eb78ff11ce0e53931ca7de49143d8a2b1c84df5', iv=>'df5f1521ed1ee7b47ae7e5ef0ac49abb', pt=>'13436402bb6c57b3f202e88cd4d21d828e85856415000e5ef01f9fe43bf100ee5b94ea29e3246200dcddbc5779dce5e219c078bbad8cd878727c0c27f179c100beefcc832f605c8e8f27251a8b51b2475d5170ff8100c95d4d875d386016535a13373f7e15d798e0c39c94193b24', ct=>'3eb5203a12d11b2fe629cd764a9963ad7f314d0efe75806c12e00f3bfe916c765a318be81337d1cb43f20c030f8af6e31991fb09477d06baa3492836f884470177584ad32241ac8fd66469fdd858ce1d04e90375689e70a4bc40be149b1df6cabc5943cff8e7cecdac6fe81fc0aac8f8' }, { mode=>'AES+Crypt::CBC', padding=>'standard', len=>47, key=>'9dd6b591b1589ff6fb5bbd41a8da4b1449674155119285857d719d44281daa3d', iv=>'321d48c36326dcc951aa208542d2fdd7', pt=>'75e4309485e3df2006c411a316073973e8adf51bfd6287a7833f15e18f2f6b571c192a527bd6290722713eb77c9116a28b321cc5decd44a5a49a13750d43e99e4d360e647300cb7b9d31a82c39d8885e6d2b5521f1c7339b30d3947bddc7323a50891f4d37a7bc9cc6971037373722', ct=>'f1f7d95a90ece772a931e3c1f919da110246268291d10d5b2a3ff62596f0cd2a0c3dbdab41e210424f5a1d35b72a4df26a32d4c9ac80e808438f31e07a4f16555a82bade488a73afe239e6c557f100cf17632a8f767445ad6db8f7d2775f63f4b4e73fc5180b20334f941f8c49f7968a' }, @@ -68,7 +68,7 @@ my $m = Crypt::Mode::CBC->new('AES', $_->{padding}); for my $l (1..33) { - + { $m->start_encrypt(pack("H*",$_->{key}), pack("H*",$_->{iv})); my $i = 0; @@ -80,7 +80,7 @@ $ct .= $m->finish; is(unpack("H*",$ct), $_->{ct}, "cipher text match [l=$l]"); } - + { $m->start_decrypt(pack("H*",$_->{key}), pack("H*",$_->{iv})); my $i = 0; @@ -92,7 +92,7 @@ $pt .= $m->finish; is(unpack("H*",$pt), $_->{pt}, "plain text match [l=$l]"); } - - } + + } } } diff --git a/t/mode_cfb.t b/t/mode_cfb.t index 78b17d4..386cc7f 100644 --- a/t/mode_cfb.t +++ b/t/mode_cfb.t @@ -4,14 +4,14 @@ use Crypt::Mode::CFB; my @tests = ( - { key=>'2b7e151628aed2a6abf7158809cf4f3c', iv=>'000102030405060708090a0b0c0d0e0f', - pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', + { key=>'2b7e151628aed2a6abf7158809cf4f3c', iv=>'000102030405060708090a0b0c0d0e0f', + pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', ct=>'3b3fd92eb72dad20333449f8e83cfb4ac8a64537a0b3a93fcde3cdad9f1ce58b26751f67a3cbb140b1808cf187a4f4dfc04b05357c5d1c0eeac4c66f9ff7f2e6' }, - { key=>'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b', iv=>'000102030405060708090a0b0c0d0e0f', - pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c', + { key=>'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b', iv=>'000102030405060708090a0b0c0d0e0f', + pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c', ct=>'cdc80d6fddf18cab34c25909c99a417467ce7f7f81173621961a2b70171d3d7a2e1e8a1dd59b88b1c8e60fed1efac4c9c05f9f9ca9834fa042ae8fba584b' }, - { key=>'603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', iv=>'000102030405060708090a0b0c0d0e0f', - pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417b', + { key=>'603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', iv=>'000102030405060708090a0b0c0d0e0f', + pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417b', ct=>'dc7e84bfda79164b7ecd8486985d386039ffed143b28b1c832113c6331e5407bdf10132415e54b92a13ed0a8267ae2f975a385741ab9cef82031623d' }, ); diff --git a/t/mode_ecb.t b/t/mode_ecb.t index 0f7dab1..1e01933 100644 --- a/t/mode_ecb.t +++ b/t/mode_ecb.t @@ -6,14 +6,14 @@ my @tests; # test vectors from http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf -push @tests, +push @tests, { padding=>'none', key=>'2b7e151628aed2a6abf7158809cf4f3c', pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', ct=>'3ad77bb40d7a3660a89ecaf32466ef97f5d3d58503b9699de785895a96fdbaaf43b1cd7f598ece23881b00e3ed0306887b0c785e27e8ad3f8223207104725dd4' }, { padding=>'none', key=>'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b', pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', ct=>'bd334f1d6e45f25ff712a214571fa5cc974104846d0ad3ad7734ecb3ecee4eefef7afd2270e2e60adce0ba2face6444e9a4b41ba738d6c72fb16691603c18e0e' }, { padding=>'none', key=>'603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', ct=>'f3eed1bdb5d2a03c064b5a7e3db181f8591ccb10d410ed26dc5ba74a31362870b6ed21b99ca6f4f9f153e7b1beafed1d23304b7a39f9f3ff067d8d8f9e24ecc7' }, -; +; # test vectors produced by Crypt::ECB -push @tests, +push @tests, { mode=>'AES+Crypt::ECB', padding=>'standard', len=>45, key=>'9c1975bc3f89e58f790e8e1cdaeea5cc1147fa43c5da2f9ae681274bd406a663', pt=>'a99303fcd37a6c39acb2dd2f3955cbcdf2d4643cc5542019f549ca2b62a4b27a099f42e0a8fb90fc53f0f32c5402f89822215472d1a5c5e8e299090cfeb80151222922c91aa0a8e21ff07147ca62a4542cc36fb437ff2f56be51e6db4e763252960b4a02cfda2fb8a74a63c0fa', ct=>'b52d56dfbd230e87af5d6cd122b050ba4dacfa112e214359d04626efbf57ccde810246076261e0dd7be797bc9b07b20c3a737f72822498fecc68d73ff6c057a1313684058ff1110af0e59347953e1b337b6dbcb852f9210099ea4b54482ae4d9069193d5cb22c6cdfad968a27771b38b' }, { mode=>'AES+Crypt::ECB', padding=>'standard', len=>46, key=>'11748a8de11e393c610eb582ee3534414f7187790435cdcbe1fd5f7c6db757be', pt=>'ff6da3d97b3907fcc171090bdcc97a43d98cde4bd76937eb672e3a4ce04b15de634d6c320bbe0b84304e52fbf004111f0d0671674196b3ea380f09295a04deb1f26b4d49bc239669bbed6b9316277516914ca4f30d570c156ea90f58565cbf26ead7c6d04eb411b83ef2445a914c', ct=>'91f00f683e3a381ebadb9553db928776fa972a06ca73a31e38ba6501d0f7b27c0013dcf3b25b3206ccd2083fcc815eaa3f843fa14ceca9e54a687b69d0e515dff1cf4b756744f242955b766c87473275ffa6c2191c89ad064c4b83e95ded84514613bc5d7763ffc0b0ec2281bf36d76c' }, { mode=>'AES+Crypt::ECB', padding=>'standard', len=>47, key=>'d36ba22781e756dfe5e64bc9729e7d50bc00a24133ea90de1d77e666e9b39bb5', pt=>'a74a52d0a02d9e959127a1fa84790605828c6e1e8a9d71ff78320b1bc888affb3e19db2c5e62233ef6ab4adf89524efe369b12259925461b88d412d8276e5e80f327addee10c3e99778e0df730cf70509faef08e7c22b2142cc6201474465b47af54e99299290117eca9514a583ecf', ct=>'1e768190063599f2be4309a27c2d1b294714bb567f231ea9ad17fe31c183b3ab2d3db1b95a3e646aa88c35d98b3ce193640e2013e643b5da787087a2a115b1f61370e42943c90c384c64b128eeaa06c98b0c7b9e9a3c2b875100c5fb9703c5e94dc394c45ffc079d2ba75ad2b342100e' }, @@ -55,7 +55,7 @@ my $ct = pack("H*", $_->{ct}); my $m = Crypt::Mode::ECB->new('AES', $_->{padding}); for my $l (1..33) { - + { $m->start_encrypt(pack("H*",$_->{key})); my $i = 0; @@ -67,7 +67,7 @@ $ct .= $m->finish; is(unpack("H*",$ct), $_->{ct}, "cipher text match [l=$l]"); } - + { $m->start_decrypt(pack("H*",$_->{key})); my $i = 0; @@ -79,7 +79,7 @@ $pt .= $m->finish; is(unpack("H*",$pt), $_->{pt}, "plain text match [l=$l]"); } - - } + + } } } diff --git a/t/mode_ofb.t b/t/mode_ofb.t index 84266db..843d2ea 100644 --- a/t/mode_ofb.t +++ b/t/mode_ofb.t @@ -4,14 +4,14 @@ use Crypt::Mode::OFB; my @tests = ( - { key=>'2b7e151628aed2a6abf7158809cf4f3c', iv=>'000102030405060708090a0b0c0d0e0f', - pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', + { key=>'2b7e151628aed2a6abf7158809cf4f3c', iv=>'000102030405060708090a0b0c0d0e0f', + pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710', ct=>'3b3fd92eb72dad20333449f8e83cfb4a7789508d16918f03f53c52dac54ed8259740051e9c5fecf64344f7a82260edcc304c6528f659c77866a510d9c1d6ae5e' }, - { key=>'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b', iv=>'000102030405060708090a0b0c0d0e0f', - pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c', + { key=>'8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b', iv=>'000102030405060708090a0b0c0d0e0f', + pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c', ct=>'cdc80d6fddf18cab34c25909c99a4174fcc28b8d4c63837c09e81700c11004018d9a9aeac0f6596f559c6d4daf59a5f26d9f200857ca6c3e9cac524bd9ac' }, - { key=>'603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', iv=>'000102030405060708090a0b0c0d0e0f', - pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417b', + { key=>'603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', iv=>'000102030405060708090a0b0c0d0e0f', + pt=>'6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417b', ct=>'dc7e84bfda79164b7ecd8486985d38604febdc6740d20b3ac88f6ad82a4fb08d71ab47a086e86eedf39d1c5bba97c4080126141d67f37be8538f5a8b' }, ); diff --git a/t/pk_dh.t b/t/pk_dh.t index c17ecaf..7c43a35 100644 --- a/t/pk_dh.t +++ b/t/pk_dh.t @@ -13,15 +13,15 @@ ok($k->is_private, 'is_private cryptx_priv_dh1.bin'); is($k->size, 256, 'size'); is(uc($k->key2hash->{x}), '73CA6A11B1595C06AB08E8E0875B9689E265C29E3F52FBC7830F071AEA4AF5A26D23CFBC96101267', 'key2hash'); - + $k = Crypt::PK::DH->new('t/data/cryptx_priv_dh2.bin'); ok($k, 'load cryptx_priv_dh2.bin'); ok($k->is_private, 'is_private cryptx_priv_dh2.bin'); - + $k = Crypt::PK::DH->new('t/data/cryptx_pub_dh1.bin'); ok($k, 'load cryptx_pub_dh1.bin'); ok(!$k->is_private, 'is_private cryptx_pub_dh1.bin'); - + $k = Crypt::PK::DH->new('t/data/cryptx_pub_dh2.bin'); ok($k, 'load cryptx_pub_dh2.bin'); ok(!$k->is_private, 'is_private cryptx_pub_dh2.bin'); @@ -35,15 +35,15 @@ ok($k->is_private, 'is_private cryptx_priv_dh_pg1.bin'); is($k->size, 256, 'size'); is(uc($k->key2hash->{x}), '3E2F764CDAD2EDFEC737E2198C9C4FAFBA4274C8A73A9E2FDCBC11954D8B48C375399E4BDE930EC9', 'key2hash'); - + $k = Crypt::PK::DH->new('t/data/cryptx_priv_dh_pg2.bin'); ok($k, 'load cryptx_priv_dh_pg2.bin'); ok($k->is_private, 'is_private cryptx_priv_dh_pg2.bin'); - + $k = Crypt::PK::DH->new('t/data/cryptx_pub_dh_pg1.bin'); ok($k, 'load cryptx_pub_dh_pg1.bin'); ok(!$k->is_private, 'is_private cryptx_pub_dh_pg1.bin'); - + $k = Crypt::PK::DH->new('t/data/cryptx_pub_dh_pg2.bin'); ok($k, 'load cryptx_pub_dh_pg2.bin'); ok(!$k->is_private, 'is_private cryptx_pub_dh_pg2.bin'); @@ -59,7 +59,7 @@ $pr2->import_key('t/data/cryptx_priv_dh2.bin'); my $pu2 = Crypt::PK::DH->new; $pu2->import_key('t/data/cryptx_pub_dh2.bin'); - + my $ss1 = $pr1->shared_secret($pu2); my $ss2 = $pr2->shared_secret($pu1); is(unpack("H*",$ss1), unpack("H*",$ss2), 'shared_secret'); @@ -70,12 +70,12 @@ $pr1->import_key('t/data/cryptx_priv_dh_pg1.bin'); my $pu1 = Crypt::PK::DH->new; $pu1->import_key('t/data/cryptx_pub_dh_pg1.bin'); - + my $pr2 = Crypt::PK::DH->new; $pr2->import_key('t/data/cryptx_priv_dh_pg2.bin'); my $pu2 = Crypt::PK::DH->new; $pu2->import_key('t/data/cryptx_pub_dh_pg2.bin'); - + my $ss1 = $pr1->shared_secret($pu2); my $ss2 = $pr2->shared_secret($pu1); is(unpack("H*",$ss1), unpack("H*",$ss2), 'shared_secret'); diff --git a/t/pk_dsa.t b/t/pk_dsa.t index c667efc..6926022 100644 --- a/t/pk_dsa.t +++ b/t/pk_dsa.t @@ -17,43 +17,43 @@ $k = Crypt::PK::DSA->new('t/data/cryptx_priv_dsa2.der'); ok($k, 'load cryptx_priv_dsa2.der'); ok($k->is_private, 'is_private cryptx_priv_dsa2.der'); - + $k = Crypt::PK::DSA->new('t/data/cryptx_pub_dsa1.der'); ok($k, 'load cryptx_pub_dsa1.der'); ok(!$k->is_private, 'is_private cryptx_pub_dsa1.der'); - + $k = Crypt::PK::DSA->new('t/data/cryptx_pub_dsa2.der'); ok($k, 'load cryptx_pub_dsa2.der'); ok(!$k->is_private, 'is_private cryptx_pub_dsa2.der'); - + $k = Crypt::PK::DSA->new('t/data/openssl_dsa1.der'); ok($k, 'load openssl_dsa1.der'); ok($k->is_private, 'is_private openssl_dsa1.der'); - + $k = Crypt::PK::DSA->new('t/data/openssl_dsa2.der'); ok($k, 'load openssl_dsa2.der'); ok($k->is_private, 'is_private openssl_dsa2.der'); - + $k = Crypt::PK::DSA->new('t/data/cryptx_priv_dsa1.pem'); ok($k, 'load cryptx_priv_dsa1.pem'); ok($k->is_private, 'is_private cryptx_priv_dsa1.pem'); - + $k = Crypt::PK::DSA->new('t/data/cryptx_priv_dsa2.pem'); ok($k, 'load cryptx_priv_dsa2.pem'); ok($k->is_private, 'is_private cryptx_priv_dsa2.pem'); - + $k = Crypt::PK::DSA->new('t/data/cryptx_pub_dsa1.pem'); ok($k, 'load cryptx_pub_dsa1.pem'); ok(!$k->is_private, 'is_private cryptx_pub_dsa1.pem'); - + $k = Crypt::PK::DSA->new('t/data/cryptx_pub_dsa2.pem'); ok($k, 'load cryptx_pub_dsa2.pem'); ok(!$k->is_private, 'is_private cryptx_pub_dsa2.pem'); - + $k = Crypt::PK::DSA->new('t/data/openssl_dsa1.pem'); ok($k, 'load openssl_dsa1.pem'); ok($k->is_private, 'is_private openssl_dsa1.pem'); - + $k = Crypt::PK::DSA->new('t/data/openssl_dsa2.pem'); ok($k, 'load openssl_dsa2.pem'); ok($k->is_private, 'is_private openssl_dsa2.pem'); @@ -64,7 +64,7 @@ $pr1->import_key('t/data/cryptx_priv_dsa1.der'); my $pu1 = Crypt::PK::DSA->new; $pu1->import_key('t/data/cryptx_pub_dsa1.der'); - + my $ct = $pu1->encrypt("secret message"); my $pt = $pr1->decrypt($ct); ok(length $ct > 200, 'encrypt ' . length($ct)); @@ -77,13 +77,13 @@ my $hash = pack("H*","04624fae618e9ad0c5e479f62e1420c71fff34dd"); $sig = $pr1->sign_hash($hash, 'SHA1'); ok(length $sig > 60, 'sign_hash ' . length($sig)); - ok($pu1->verify_hash($sig, $hash, 'SHA1'), 'verify_hash'); - + ok($pu1->verify_hash($sig, $hash, 'SHA1'), 'verify_hash'); + my $pr2 = Crypt::PK::DSA->new; $pr2->import_key('t/data/cryptx_priv_dsa2.der'); my $pu2 = Crypt::PK::DSA->new; $pu2->import_key('t/data/cryptx_pub_dsa2.der'); - + #my $ss1 = $pr1->shared_secret($pu2); #my $ss2 = $pr2->shared_secret($pu1); #is(unpack("H*",$ss1), unpack("H*",$ss2), 'shared_secret'); diff --git a/t/pk_ecc.t b/t/pk_ecc.t index 5ea9bbb..e247f5c 100644 --- a/t/pk_ecc.t +++ b/t/pk_ecc.t @@ -30,28 +30,28 @@ $k = Crypt::PK::ECC->new('t/data/cryptx_priv_ecc2.der'); ok($k, 'load cryptx_priv_ecc2.der'); ok($k->is_private, 'is_private cryptx_priv_ecc2.der'); - + $k = Crypt::PK::ECC->new('t/data/cryptx_pub_ecc1.der'); ok($k, 'load cryptx_pub_ecc1.der'); ok(!$k->is_private, 'is_private cryptx_pub_ecc1.der'); - + $k = Crypt::PK::ECC->new('t/data/cryptx_pub_ecc2.der'); ok($k, 'load cryptx_pub_ecc2.der'); ok(!$k->is_private, 'is_private cryptx_pub_ecc2.der'); - + ### XXX-TODO regenerate keys $k = Crypt::PK::ECC->new('t/data/cryptx_priv_ecc1.pem'); ok($k, 'load cryptx_priv_ecc1.pem'); ok($k->is_private, 'is_private cryptx_priv_ecc1.pem'); - + $k = Crypt::PK::ECC->new('t/data/cryptx_priv_ecc2.pem'); ok($k, 'load cryptx_priv_ecc2.pem'); ok($k->is_private, 'is_private cryptx_priv_ecc2.pem'); - + $k = Crypt::PK::ECC->new('t/data/cryptx_pub_ecc1.pem'); ok($k, 'load cryptx_pub_ecc1.pem'); ok(!$k->is_private, 'is_private cryptx_pub_ecc1.pem'); - + $k = Crypt::PK::ECC->new('t/data/cryptx_pub_ecc2.pem'); ok($k, 'load cryptx_pub_ecc2.pem'); ok(!$k->is_private, 'is_private cryptx_pub_ecc2.pem'); @@ -88,12 +88,12 @@ $pr1->import_key('t/data/cryptx_priv_ecc1.der'); my $pu1 = Crypt::PK::ECC->new; $pu1->import_key('t/data/cryptx_pub_ecc1.der'); - + my $ct = $pu1->encrypt("secret message"); my $pt = $pr1->decrypt($ct); ok(length $ct > 30, 'encrypt ' . length($ct)); is($pt, "secret message", 'decrypt'); - + my $sig = $pr1->sign_message("message"); ok(length $sig > 60, 'sign_message ' . length($sig)); ok($pu1->verify_message($sig, "message"), 'verify_message'); @@ -105,13 +105,13 @@ my $hash = pack("H*","04624fae618e9ad0c5e479f62e1420c71fff34dd"); $sig = $pr1->sign_hash($hash, 'SHA1'); ok(length $sig > 60, 'sign_hash ' . length($sig)); - ok($pu1->verify_hash($sig, $hash, 'SHA1'), 'verify_hash'); - + ok($pu1->verify_hash($sig, $hash, 'SHA1'), 'verify_hash'); + my $pr2 = Crypt::PK::ECC->new; $pr2->import_key('t/data/cryptx_priv_ecc2.der'); my $pu2 = Crypt::PK::ECC->new; $pu2->import_key('t/data/cryptx_pub_ecc2.der'); - + my $ss1 = $pr1->shared_secret($pu2); my $ss2 = $pr2->shared_secret($pu1); is(unpack("H*",$ss1), unpack("H*",$ss2), 'shared_secret'); @@ -142,7 +142,7 @@ $sig = ecc_sign_hash('t/data/cryptx_priv_ecc1.der', $hash, 'SHA1'); ok($sig, 'ecc_sign_hash'); ok(ecc_verify_hash('t/data/cryptx_pub_ecc1.der', $sig, $hash, 'SHA1'), 'ecc_verify_hash'); - + my $ss1 = ecc_shared_secret('t/data/cryptx_priv_ecc1.der', 't/data/cryptx_pub_ecc2.der'); my $ss2 = ecc_shared_secret('t/data/cryptx_priv_ecc2.der', 't/data/cryptx_pub_ecc1.der'); is(unpack("H*",$ss1), unpack("H*",$ss2), 'shared_secret'); diff --git a/t/pk_ecc_test_vectors_openssl.t b/t/pk_ecc_test_vectors_openssl.t index 9569c52..982f869 100644 --- a/t/pk_ecc_test_vectors_openssl.t +++ b/t/pk_ecc_test_vectors_openssl.t @@ -77,7 +77,7 @@ for my $h (@$data) { my $ec_pri = Crypt::PK::ECC->new->import_key_raw(pack("H*",$h->{PRI}), $h->{CURVE}); my $ec_pub = Crypt::PK::ECC->new->import_key_raw(pack("H*",$h->{PUB}), $h->{CURVE}); - my $ec_pubc = Crypt::PK::ECC->new->import_key_raw(pack("H*",$h->{PUBC}), $h->{CURVE}); + my $ec_pubc = Crypt::PK::ECC->new->import_key_raw(pack("H*",$h->{PUBC}), $h->{CURVE}); is( unpack("H*", $ec_pub ->export_key_raw('public_compressed')), $h->{PUBC}, "$h->{PRI_FILE}/ec_pub public compressed"); is( unpack("H*", $ec_pub ->export_key_raw('public')) , $h->{PUB}, "$h->{PRI_FILE}/ec_pub public uncompressed"); is( unpack("H*", $ec_pubc->export_key_raw('public_compressed')), $h->{PUBC}, "$h->{PRI_FILE}/ec_pubc public compressed"); diff --git a/t/pk_rsa.t b/t/pk_rsa.t index 378c532..7e49a18 100644 --- a/t/pk_rsa.t +++ b/t/pk_rsa.t @@ -16,48 +16,48 @@ $k = Crypt::PK::RSA->new('t/data/cryptx_priv_rsa2.der'); ok($k, 'load cryptx_priv_rsa2.der'); ok($k->is_private, 'is_private cryptx_priv_rsa2.der'); - + $k = Crypt::PK::RSA->new('t/data/cryptx_pub_rsa1.der'); ok($k, 'load cryptx_pub_rsa1.der'); ok(!$k->is_private, 'is_private cryptx_pub_rsa1.der'); - + $k = Crypt::PK::RSA->new('t/data/cryptx_pub_rsa2.der'); ok($k, 'load cryptx_pub_rsa2.der'); ok(!$k->is_private, 'is_private cryptx_pub_rsa2.der'); - + $k = Crypt::PK::RSA->new('t/data/openssl_rsa1.der'); ok($k, 'load openssl_rsa1.der'); ok($k->is_private, 'is_private openssl_rsa1.der'); - + $k = Crypt::PK::RSA->new('t/data/openssl_rsa2.der'); ok($k, 'load openssl_rsa2.der'); ok($k->is_private, 'is_private openssl_rsa2.der'); - + $k = Crypt::PK::RSA->new('t/data/cryptx_priv_rsa1.pem'); ok($k, 'load cryptx_priv_rsa1.pem'); ok($k->is_private, 'is_private cryptx_priv_rsa1.pem'); - + $k = Crypt::PK::RSA->new('t/data/cryptx_priv_rsa2.pem'); ok($k, 'load cryptx_priv_rsa2.pem'); ok($k->is_private, 'is_private cryptx_priv_rsa2.pem'); - + $k = Crypt::PK::RSA->new('t/data/cryptx_pub_rsa1.pem'); ok($k, 'load cryptx_pub_rsa1.pem'); ok(!$k->is_private, 'is_private cryptx_pub_rsa1.pem'); - + $k = Crypt::PK::RSA->new('t/data/cryptx_pub_rsa2.pem'); ok($k, 'load cryptx_pub_rsa2.pem'); ok(!$k->is_private, 'is_private cryptx_pub_rsa2.pem'); - + $k = Crypt::PK::RSA->new('t/data/openssl_rsa1.pem'); ok($k, 'load openssl_rsa1.pem'); ok($k->is_private, 'is_private openssl_rsa1.pem'); - + $k = Crypt::PK::RSA->new('t/data/openssl_rsa2.pem'); ok($k, 'load openssl_rsa2.pem'); ok($k->is_private, 'is_private openssl_rsa2.pem'); - # X509 + # X509 $k = Crypt::PK::RSA->new('t/data/openssl_rsa-x509.pem'); ok($k, 'openssl_rsa-x509.pem'); ok(!$k->is_private, 'not private openssl_rsa-x509.pem'); @@ -71,12 +71,12 @@ $pr1->import_key('t/data/cryptx_priv_rsa1.der'); my $pu1 = Crypt::PK::RSA->new; $pu1->import_key('t/data/cryptx_pub_rsa1.der'); - + my $ct = $pu1->encrypt("secret message"); my $pt = $pr1->decrypt($ct); ok(length $ct > 200, 'encrypt ' . length($ct)); is($pt, "secret message", 'decrypt'); - + my $sig = $pr1->sign_message("message"); ok(length $sig > 60, 'sign_message ' . length($sig)); ok($pu1->verify_message($sig, "message"), 'verify_message'); diff --git a/t/prng.t b/t/prng.t index 210d28e..8573f17 100644 --- a/t/prng.t +++ b/t/prng.t @@ -11,42 +11,42 @@ my $sum = 0; $sum += $r->double for (1..1000); my $avg = $sum/1000; - ok($avg>0.4 && $avg<0.6, "rand $avg"); + ok($avg>0.4 && $avg<0.6, "rand $avg"); } { my $sum = 0; $sum += $r->double(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += $r->int32 for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { my $sum = 0; $sum += rand(80) for (1..1000); my $avg = $sum/1000; - ok($avg>30 && $avg<50, "rand $avg"); + ok($avg>30 && $avg<50, "rand $avg"); } { my $sum = 0; $sum += rand(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += irand for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { @@ -56,7 +56,7 @@ like($r->bytes_hex(55), qr/^[0-9A-Fa-f]{110}$/, "bytes_hex"); like($r->bytes_b64(60), qr/^[A-Za-z0-9+\/=]{80}$/, "bytes_b64"); like($r->bytes_b64u(60), qr/^[A-Za-z0-9_-]{80}$/, "bytes_b64u"); - + like(random_string(45), qr/^[A-Z-a-z0-9]+$/, 'string'); like(random_string_from("ABC,.-", 45), qr/^[ABC,\,\.\-]+$/, 'string'); is(length random_bytes(55), 55, "bytes"); diff --git a/t/prng_chacha20.t b/t/prng_chacha20.t index f2b8182..e3807cc 100644 --- a/t/prng_chacha20.t +++ b/t/prng_chacha20.t @@ -11,42 +11,42 @@ my $sum = 0; $sum += $r->double for (1..1000); my $avg = $sum/1000; - ok($avg>0.4 && $avg<0.6, "rand $avg"); + ok($avg>0.4 && $avg<0.6, "rand $avg"); } { my $sum = 0; $sum += $r->double(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += $r->int32 for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { my $sum = 0; $sum += rand(80) for (1..1000); my $avg = $sum/1000; - ok($avg>30 && $avg<50, "rand $avg"); + ok($avg>30 && $avg<50, "rand $avg"); } { my $sum = 0; $sum += rand(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += irand for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { @@ -56,7 +56,7 @@ like($r->bytes_hex(55), qr/^[0-9A-Fa-f]{110}$/, "bytes_hex"); like($r->bytes_b64(60), qr/^[A-Za-z0-9+\/=]{80}$/, "bytes_b64"); like($r->bytes_b64u(60), qr/^[A-Za-z0-9_-]{80}$/, "bytes_b64u"); - + like(random_string(45), qr/^[A-Z-a-z0-9]+$/, 'string'); like(random_string_from("ABC,.-", 45), qr/^[ABC,\,\.\-]+$/, 'string'); is(length random_bytes(55), 55, "bytes"); diff --git a/t/prng_fortuna.t b/t/prng_fortuna.t index c14a5f9..6b2239c 100644 --- a/t/prng_fortuna.t +++ b/t/prng_fortuna.t @@ -11,42 +11,42 @@ my $sum = 0; $sum += $r->double for (1..1000); my $avg = $sum/1000; - ok($avg>0.4 && $avg<0.6, "rand $avg"); + ok($avg>0.4 && $avg<0.6, "rand $avg"); } { my $sum = 0; $sum += $r->double(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += $r->int32 for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { my $sum = 0; $sum += rand(80) for (1..1000); my $avg = $sum/1000; - ok($avg>30 && $avg<50, "rand $avg"); + ok($avg>30 && $avg<50, "rand $avg"); } { my $sum = 0; $sum += rand(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += irand for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { @@ -56,7 +56,7 @@ like($r->bytes_hex(55), qr/^[0-9A-Fa-f]{110}$/, "bytes_hex"); like($r->bytes_b64(60), qr/^[A-Za-z0-9+\/=]{80}$/, "bytes_b64"); like($r->bytes_b64u(60), qr/^[A-Za-z0-9_-]{80}$/, "bytes_b64u"); - + like(random_string(45), qr/^[A-Z-a-z0-9]+$/, 'string'); like(random_string_from("ABC,.-", 45), qr/^[ABC,\,\.\-]+$/, 'string'); is(length random_bytes(55), 55, "bytes"); diff --git a/t/prng_rc4.t b/t/prng_rc4.t index a88ecf4..37c1cfb 100644 --- a/t/prng_rc4.t +++ b/t/prng_rc4.t @@ -11,42 +11,42 @@ my $sum = 0; $sum += $r->double for (1..1000); my $avg = $sum/1000; - ok($avg>0.4 && $avg<0.6, "rand $avg"); + ok($avg>0.4 && $avg<0.6, "rand $avg"); } { my $sum = 0; $sum += $r->double(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += $r->int32 for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { my $sum = 0; $sum += rand(80) for (1..1000); my $avg = $sum/1000; - ok($avg>30 && $avg<50, "rand $avg"); + ok($avg>30 && $avg<50, "rand $avg"); } { my $sum = 0; $sum += rand(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += irand for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { @@ -56,7 +56,7 @@ like($r->bytes_hex(55), qr/^[0-9A-Fa-f]{110}$/, "bytes_hex"); like($r->bytes_b64(60), qr/^[A-Za-z0-9+\/=]{80}$/, "bytes_b64"); like($r->bytes_b64u(60), qr/^[A-Za-z0-9_-]{80}$/, "bytes_b64u"); - + like(random_string(45), qr/^[A-Z-a-z0-9]+$/, 'string'); like(random_string_from("ABC,.-", 45), qr/^[ABC,\,\.\-]+$/, 'string'); is(length random_bytes(55), 55, "bytes"); diff --git a/t/prng_sober128.t b/t/prng_sober128.t index 7bb032e..dc5ef24 100644 --- a/t/prng_sober128.t +++ b/t/prng_sober128.t @@ -11,42 +11,42 @@ my $sum = 0; $sum += $r->double for (1..1000); my $avg = $sum/1000; - ok($avg>0.4 && $avg<0.6, "rand $avg"); + ok($avg>0.4 && $avg<0.6, "rand $avg"); } { my $sum = 0; $sum += $r->double(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += $r->int32 for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { my $sum = 0; $sum += rand(80) for (1..1000); my $avg = $sum/1000; - ok($avg>30 && $avg<50, "rand $avg"); + ok($avg>30 && $avg<50, "rand $avg"); } { my $sum = 0; $sum += rand(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += irand for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { @@ -56,7 +56,7 @@ like($r->bytes_hex(55), qr/^[0-9A-Fa-f]{110}$/, "bytes_hex"); like($r->bytes_b64(60), qr/^[A-Za-z0-9+\/=]{80}$/, "bytes_b64"); like($r->bytes_b64u(60), qr/^[A-Za-z0-9_-]{80}$/, "bytes_b64u"); - + like(random_string(45), qr/^[A-Z-a-z0-9]+$/, 'string'); like(random_string_from("ABC,.-", 45), qr/^[ABC,\,\.\-]+$/, 'string'); is(length random_bytes(55), 55, "bytes"); diff --git a/t/prng_yarrow.t b/t/prng_yarrow.t index ee43337..c69d004 100644 --- a/t/prng_yarrow.t +++ b/t/prng_yarrow.t @@ -11,42 +11,42 @@ my $sum = 0; $sum += $r->double for (1..1000); my $avg = $sum/1000; - ok($avg>0.4 && $avg<0.6, "rand $avg"); + ok($avg>0.4 && $avg<0.6, "rand $avg"); } { my $sum = 0; $sum += $r->double(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += $r->int32 for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { my $sum = 0; $sum += rand(80) for (1..1000); my $avg = $sum/1000; - ok($avg>30 && $avg<50, "rand $avg"); + ok($avg>30 && $avg<50, "rand $avg"); } { my $sum = 0; $sum += rand(-180) for (1..1000); my $avg = $sum/1000; - ok($avg>-100 && $avg<-80, "rand $avg"); + ok($avg>-100 && $avg<-80, "rand $avg"); } { my $sum = 0; $sum += irand for (1..1000); my $avg = $sum/1000; - ok($avg>2**30 && $avg<2**32, "rand $avg"); + ok($avg>2**30 && $avg<2**32, "rand $avg"); } { @@ -56,7 +56,7 @@ like($r->bytes_hex(55), qr/^[0-9A-Fa-f]{110}$/, "bytes_hex"); like($r->bytes_b64(60), qr/^[A-Za-z0-9+\/=]{80}$/, "bytes_b64"); like($r->bytes_b64u(60), qr/^[A-Za-z0-9_-]{80}$/, "bytes_b64u"); - + like(random_string(45), qr/^[A-Z-a-z0-9]+$/, 'string'); like(random_string_from("ABC,.-", 45), qr/^[ABC,\,\.\-]+$/, 'string'); is(length random_bytes(55), 55, "bytes");