Package list libcryptx-perl / b3d0c9e
New upstream version 0.055 Damyan Ivanov 3 years ago
155 changed file(s) with 826 addition(s) and 583 deletion(s). Raw diff Collapse all Expand all
00 Changes for CryptX
11
2 0.054_* 2017-10-XX
2 0.055 2017-11-28
33 - new Crypt::Cipher::IDEA
44 - new Crypt::Cipher::Serpent
55 - new Crypt::Stream::Salsa20
66 - new Crypt::Stream::Sosemanuk
7 - added CCM OO interface: new-add-add-done
7 - added CCM object oriented interface: new-add-add-done
8 - fix #39 accept CFLAGS and CPPFLAGS from the environment
9 - fix #40 typos in POD
10 - fix HMAC+SHA3 (now compliant with NIST test vectors)
811
912 0.054 2017-10-12
1013 - fix Crypt::PK::DSA verify
671671 t/001_compile.t
672672 t/002_all_pm.t
673673 t/003_all_pm_pod.t
674 t/004_all_pm_pod_spelling.t
675 t/005_all_pm_pod_coverage.t
674676 t/auth_enc_ccm.t
675677 t/auth_enc_ccm_test_vector_ltc.t
676678 t/auth_enc_chacha20poly1305.t
924926 t/mac_blake2s.t
925927 t/mac_f9.t
926928 t/mac_hmac.t
929 t/mac_hmac_nist.t
927930 t/mac_hmac_test_vectors_ltc.t
928931 t/mac_omac.t
929932 t/mac_omac_test_vectors_ltc.t
3535 }
3636 }
3737 },
38 "release_status" : "unstable",
38 "release_status" : "stable",
3939 "resources" : {
4040 "bugtracker" : {
4141 "web" : "https://github.com/DCIT/perl-CryptX/issues"
4444 "url" : "https://github.com/DCIT/perl-CryptX"
4545 }
4646 },
47 "version" : "0.054_006",
47 "version" : "0.055",
4848 "x_serialization_backend" : "JSON::PP version 2.94"
4949 }
2121 resources:
2222 bugtracker: https://github.com/DCIT/perl-CryptX/issues
2323 repository: https://github.com/DCIT/perl-CryptX
24 version: 0.054_006
24 version: '0.055'
2525 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
1212 my $myextlib = "src/liballinone$Config{lib_ext}";
1313 my $mycflags = "$Config{ccflags} $Config{cccdlflags} $Config{optimize}";
1414
15 #FIX: this is particularly useful for Debian https://github.com/DCIT/perl-CryptX/pull/39
16 $mycflags .= " $ENV{CFLAGS}" if $ENV{CFLAGS};
17 $mycflags .= " $ENV{CPPFLAGS}" if $ENV{CPPFLAGS};
18
1519 #FIX: gcc with -flto is a trouble maker see https://github.com/DCIT/perl-CryptX/issues/32
1620 $mycflags =~ s/-flto\b//g;
1721
2226 $mycflags =~ s/-ansi\b//g;
2327 $mycflags =~ s/-Wwrite-strings\b//g;
2428 $mycflags =~ s/-Wcast-qual\b//g;
25
26 #FIX: this is particularly useful for Debian https://github.com/DCIT/perl-CryptX/pull/39
27 $mycflags = "$ENV{CFLAGS} $ENV{CPPFLAGS}" if $ENV{CFLAGS} || $ENV{CPPFLAGS};
2829
2930 #FIX: avoid "ar: fatal: Numeric group ID too large" see https://github.com/DCIT/perl-CryptX/issues/33
3031 my $myarflags = '$(AR_STATIC_ARGS)';
8990 my $version_patch = q{
9091 versionsync:
9192 $(NOECHO) perl _generators/version_patch.pl sync
92
9393 versioninc:
9494 $(NOECHO) perl _generators/version_patch.pl inc
95
9695 versionincdev:
9796 $(NOECHO) perl _generators/version_patch.pl incdev
98
9997 versiondec:
10098 $(NOECHO) perl _generators/version_patch.pl dec
101
10299 versiondecdev:
103100 $(NOECHO) perl _generators/version_patch.pl decdev
101 gencode:
102 $(NOECHO) perl _generators/gen.pl gencode
103 gentest: all
104 $(NOECHO) perl _generators/gen.pl gentest
105 openssltest: all
106 $(NOECHO) perl -Mblib t/openssl/dsa-test.pl
107 $(NOECHO) perl -Mblib t/openssl/ecc-test.pl
108 $(NOECHO) perl -Mblib t/openssl/rsa-test.pl
104109 };
105110
106111 return "$myextlib\n$version_patch";
00 # NAME
11
2 CryptX - Crypto toolkit (self-contained no external libraries needed)
2 CryptX - Cryptographic toolkit (self-contained, no external libraries needed)
33
44 # DESCRIPTION
55
77
88 Currently available modules:
99
10 - Ciphers - see [Crypt::Cipher](https://metacpan.org/pod/Crypt::Cipher) and related modules
10 - Symmetric ciphers - see [Crypt::Cipher](https://metacpan.org/pod/Crypt::Cipher) and related modules
1111
1212 [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),
1313 [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),
2121
2222 - Stream ciphers
2323
24 [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)
24 [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)
2525
2626 - Authenticated encryption modes
2727
3636 [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),
3737 [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)
3838
39 - Checksums
40
41 [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)
42
3943 - Message Authentication Codes
4044
41 [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)
45 [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),
46 [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)
4247
4348 - Public key cryptography
4449
4853
4954 [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)
5055
51 - Key derivation functions - PBKDF1, PBKFD2 and HKDF
56 - Key derivation functions - PBKDF1, PBKDF2 and HKDF
5257
5358 [Crypt::KeyDerivation](https://metacpan.org/pod/Crypt::KeyDerivation)
5459
7373 RETVAL = newSVpvn("", 0);
7474 }
7575 else {
76 if (in_data_len % (&self->state)->block_len) {
77 croak ("FATAL: sizeof(data) should be multiple of blocksize (%d)", (&self->state)->block_len);
76 if (in_data_len % 16) {
77 croak ("FATAL: sizeof(data) should be multiple of 16");
7878 }
7979 RETVAL = NEWSV(0, in_data_len);
8080 SvPOK_only(RETVAL);
134134 RETVAL = newSVpvn("", 0);
135135 }
136136 else {
137 if (in_data_len % (&self->state)->block_len) {
138 croak ("FATAL: sizeof(data) should be multiple of blocksize (%d)", (&self->state)->block_len);
137 if (in_data_len % 16) {
138 croak ("FATAL: sizeof(data) should be multiple of 16");
139139 }
140140 RETVAL = NEWSV(0, in_data_len);
141141 SvPOK_only(RETVAL);
225225 }
226226 }
227227 }
228
229 int
230 blocksize(Crypt::AuthEnc::OCB self)
231 CODE:
232 {
233 RETVAL = (&self->state)->block_len;
234 }
235 OUTPUT:
236 RETVAL
3030
3131 rv = pkcs_5_alg1(password_ptr, (unsigned long)password_len, salt_ptr, iteration_count, id, output, &output_len);
3232 if (rv != CRYPT_OK) {
33 SvREFCNT_dec(RETVAL);
33 SvREFCNT_dec(RETVAL);
3434 croak("FATAL: pkcs_5_alg1 process failed: %s", error_to_string(rv));
3535 }
3636 SvCUR_set(RETVAL, output_len);
6868
6969 rv = pkcs_5_alg2(password_ptr, (unsigned long)password_len, salt_ptr, (unsigned long)salt_len, iteration_count, id, output, &output_len);
7070 if (rv != CRYPT_OK) {
71 SvREFCNT_dec(RETVAL);
71 SvREFCNT_dec(RETVAL);
7272 croak("FATAL: pkcs_5_alg2 process failed: %s", error_to_string(rv));
7373 }
7474 SvCUR_set(RETVAL, output_len);
137137
138138 rv = hkdf_expand(id, info_ptr, (unsigned long)info_len, in_ptr, (unsigned long)in_len, output, output_len);
139139 if (rv != CRYPT_OK) {
140 SvREFCNT_dec(RETVAL);
140 SvREFCNT_dec(RETVAL);
141141 croak("FATAL: hkdf_expand process failed: %s", error_to_string(rv));
142142 }
143143 SvCUR_set(RETVAL, output_len);
178178
179179 rv = hkdf(id, salt_ptr, (unsigned long)salt_len, info_ptr, (unsigned long)info_len, in_ptr, (unsigned long)in_len, output, output_len);
180180 if (rv != CRYPT_OK) {
181 SvREFCNT_dec(RETVAL);
181 SvREFCNT_dec(RETVAL);
182182 croak("FATAL: hkdf_expand process failed: %s", error_to_string(rv));
183183 }
184184 SvCUR_set(RETVAL, output_len);
140140 size(Crypt::PK::DSA self)
141141 CODE:
142142 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
143 RETVAL = mp_unsigned_bin_size(self->key.g);
143 RETVAL = mp_unsigned_bin_size(self->key.p);
144144 OUTPUT:
145145 RETVAL
146146
148148 size_q(Crypt::PK::DSA self)
149149 CODE:
150150 if (self->key.type == -1 || self->key.qord <= 0) XSRETURN_UNDEF;
151 RETVAL = self->key.qord;
151 RETVAL = mp_unsigned_bin_size(self->key.q);
152152 OUTPUT:
153153 RETVAL
154154
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::AuthEnc Exporter);
77 our %EXPORT_TAGS = ( all => [qw( ccm_encrypt_authenticate ccm_decrypt_verify )] );
9595
9696 =head1 DESCRIPTION
9797
98 CCM is a encrypt+authenticate mode that is centered around using AES (or any 16-byte cipher) as aprimitive.
98 CCM is a encrypt+authenticate mode that is centered around using AES (or any 16-byte cipher) as a primitive.
9999 Unlike EAX and OCB mode, it is only meant for packet mode where the length of the input is known in advance.
100100
101101 =head1 EXPORT
173173 =item * L<https://en.wikipedia.org/wiki/CCM_mode|https://en.wikipedia.org/wiki/CCM_mode>
174174
175175 =back
176
177 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::AuthEnc Exporter);
77 our %EXPORT_TAGS = ( all => [qw( chacha20poly1305_encrypt_authenticate chacha20poly1305_decrypt_verify )] );
174174 =item * L<https://tools.ietf.org/html/rfc7539>
175175
176176 =back
177
178 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::AuthEnc Exporter);
77 our %EXPORT_TAGS = ( all => [qw( eax_encrypt_authenticate eax_decrypt_verify )] );
182182 =item * L<https://en.wikipedia.org/wiki/EAX_mode|https://en.wikipedia.org/wiki/EAX_mode>
183183
184184 =back
185
186 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::AuthEnc Exporter);
77 our %EXPORT_TAGS = ( all => [qw( gcm_encrypt_authenticate gcm_decrypt_verify )] );
183183 =item * L<https://en.wikipedia.org/wiki/Galois/Counter_Mode>
184184
185185 =back
186
187 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::AuthEnc Exporter);
77 our %EXPORT_TAGS = ( all => [qw( ocb_encrypt_authenticate ocb_decrypt_verify )] );
5252
5353 # obsolete, only for backwards compatibility
5454 sub aad_add { goto &adata_add }
55 sub blocksize { return 16 }
5556
5657 1;
5758
160161
161162 #BEWARE: size of $ciphertext has to be multiple of blocklen (16 for AES)
162163
163 =head2 encrypt_last
164 =head2 decrypt_last
164165
165166 $plaintext = $ae->decrypt_last($data);
166167
184185
185186 =item * L<https://tools.ietf.org/html/rfc7253>
186187
187 =back
188 =back
189
190 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 sub CLONE_SKIP { 1 } # prevent cloning
77
88 1;
99
10 __END__
10 =pod
1111
1212 =head1 NAME
1313
1414 Crypt::AuthEnc - [internal only]
1515
16 =cut
16 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
119119
120120 =back
121121
122 =cut
122 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
119119
120120 =back
121121
122 =cut
122 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw/
105105
106106 =head2 adler32_data_int
107107
108 Returns checksum as unsingned 32bit integer.
108 Returns checksum as unsigned 32bit integer.
109109
110110 $checksum_hex = adler32_data_int('data string');
111111 #or
129129
130130 =head2 adler32_file_int
131131
132 Returns checksum as unsingned 32bit integer.
132 Returns checksum as unsigned 32bit integer.
133133
134 $checksum_hex = adler32_file_int('data string');
134 $checksum_hex = adler32_file_int('filename.dat');
135135 #or
136 $checksum_hex = adler32_file_int('any data', 'more data', 'even more data');
136 $checksum_hex = adler32_file_int(*FILEHANDLE);
137137
138138 =head2 crc32_data
139139
153153
154154 =head2 crc32_data_int
155155
156 Returns checksum as unsingned 32bit integer.
156 Returns checksum as unsigned 32bit integer.
157157
158158 $checksum_hex = crc32_data_int('data string');
159159 #or
177177
178178 =head2 crc32_file_int
179179
180 Returns checksum as unsingned 32bit integer.
180 Returns checksum as unsigned 32bit integer.
181181
182 $checksum_hex = crc32_file_int('data string');
182 $checksum_hex = crc32_file_int('filename.dat');
183183 #or
184 $checksum_hex = crc32_file_int('any data', 'more data', 'even more data');
184 $checksum_hex = crc32_file_int(*FILEHANDLE);
185185
186186 =head1 SEE ALSO
187187
195195
196196 =back
197197
198 =cut
198 =cut
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::AES - Symetric cipher AES (aka Rijndael), key size: 128/192/256 bits (Crypt::CBC compliant)
23 Crypt::Cipher::AES - Symmetric cipher AES (aka Rijndael), key size: 128/192/256 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::Anubis - Symetric cipher Anubis, key size: 128-320 bits (Crypt::CBC compliant)
23 Crypt::Cipher::Anubis - Symmetric cipher Anubis, key size: 128-320 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::Blowfish - Symetric cipher Blowfish, key size: 64-448 bits (Crypt::CBC compliant)
23 Crypt::Cipher::Blowfish - Symmetric cipher Blowfish, key size: 64-448 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::CAST5 - Symetric cipher CAST5 (aka CAST-128), key size: 40-128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::CAST5 - Symmetric cipher CAST5 (aka CAST-128), key size: 40-128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::Camellia - Symetric cipher Camellia, key size: 128/192/256 bits (Crypt::CBC compliant)
23 Crypt::Cipher::Camellia - Symmetric cipher Camellia, key size: 128/192/256 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::DES - Symetric cipher DES, key size: 64[56] bits (Crypt::CBC compliant)
23 Crypt::Cipher::DES - Symmetric cipher DES, key size: 64[56] bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::DES_EDE - Symetric cipher DES_EDE (aka Tripple-DES, 3DES), key size: 192[168] bits (Crypt::CBC compliant)
23 Crypt::Cipher::DES_EDE - Symmetric cipher DES_EDE (aka Triple-DES, 3DES), key size: 192[168] bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::IDEA - Symetric cipher IDEA, key size: 128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::IDEA - Symmetric cipher IDEA, key size: 128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::KASUMI - Symetric cipher KASUMI, key size: 128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::KASUMI - Symmetric cipher KASUMI, key size: 128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::Khazad - Symetric cipher Khazad, key size: 128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::Khazad - Symmetric cipher Khazad, key size: 128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::MULTI2 - Symetric cipher MULTI2, key size: 320 bits (Crypt::CBC compliant)
23 Crypt::Cipher::MULTI2 - Symmetric cipher MULTI2, key size: 320 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::Noekeon - Symetric cipher Noekeon, key size: 128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::Noekeon - Symmetric cipher Noekeon, key size: 128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::RC2 - Symetric cipher RC2, key size: 40-1024 bits (Crypt::CBC compliant)
23 Crypt::Cipher::RC2 - Symmetric cipher RC2, key size: 40-1024 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::RC5 - Symetric cipher RC5, key size: 64-1024 bits (Crypt::CBC compliant)
23 Crypt::Cipher::RC5 - Symmetric cipher RC5, key size: 64-1024 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::RC6 - Symetric cipher RC6, key size: 64-1024 bits (Crypt::CBC compliant)
23 Crypt::Cipher::RC6 - Symmetric cipher RC6, key size: 64-1024 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::SAFERP - Symetric cipher SAFER+, key size: 128/192/256 bits (Crypt::CBC compliant)
23 Crypt::Cipher::SAFERP - Symmetric cipher SAFER+, key size: 128/192/256 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::SAFER_K128 - Symetric cipher SAFER_K128, key size: 128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::SAFER_K128 - Symmetric cipher SAFER_K128, key size: 128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::SAFER_K64 - Symetric cipher SAFER_K64, key size: 64 bits (Crypt::CBC compliant)
23 Crypt::Cipher::SAFER_K64 - Symmetric cipher SAFER_K64, key size: 64 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::SAFER_SK128 - Symetric cipher SAFER_SK128, key size: 128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::SAFER_SK128 - Symmetric cipher SAFER_SK128, key size: 128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::SAFER_SK64 - Symetric cipher SAFER_SK64, key size: 64 bits (Crypt::CBC compliant)
23 Crypt::Cipher::SAFER_SK64 - Symmetric cipher SAFER_SK64, key size: 64 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::SEED - Symetric cipher SEED, key size: 128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::SEED - Symmetric cipher SEED, key size: 128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::Serpent - Symetric cipher Serpent, key size: 128/192/256 bits (Crypt::CBC compliant)
23 Crypt::Cipher::Serpent - Symmetric cipher Serpent, key size: 128/192/256 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::Skipjack - Symetric cipher Skipjack, key size: 80 bits (Crypt::CBC compliant)
23 Crypt::Cipher::Skipjack - Symmetric cipher Skipjack, key size: 80 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::Twofish - Symetric cipher Twofish, key size: 128/192/256 bits (Crypt::CBC compliant)
23 Crypt::Cipher::Twofish - Symmetric cipher Twofish, key size: 128/192/256 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use CryptX;
99 use base 'Crypt::Cipher';
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::XTEA - Symetric cipher XTEA, key size: 128 bits (Crypt::CBC compliant)
23 Crypt::Cipher::XTEA - Symmetric cipher XTEA, key size: 128 bits (Crypt::CBC compliant)
2424
2525 =head1 SYNOPSIS
2626
116116 =back
117117
118118 =cut
119
120 __END__
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
128128
129129 =head1 DESCRIPTION
130130
131 Provides an interface to various symetric cipher algorithms.
131 Provides an interface to various symmetric cipher algorithms.
132132
133133 B<BEWARE:> This module implements just elementary "one-block-(en|de)cryption" operation - if you want to
134134 encrypt/decrypt generic data you have to use some of the cipher block modes - check for example
149149 # simply any <NAME> for which there exists Crypt::Cipher::<NAME>
150150 # $key = binary key (keysize should comply with selected cipher requirements)
151151
152 ## some of the ciphers (e.g. MULTI2, RC5, SAFER) allows to set number of rounds
152 ## some of the ciphers (e.g. MULTI2, RC5, SAFER) allow one to set number of rounds
153153 $d = Crypt::Cipher->new('MULTI2', $key, $rounds);
154154 # $rounds = positive integer (should comply with selected cipher requirements)
155155
201201
202202 =head2 default_rounds
203203
204 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().
204 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().
205205
206206 $d->default_rounds;
207207 #or
220220 =back
221221
222222 =cut
223
224 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
224224 =back
225225
226226 =cut
227
228 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
224224 =back
225225
226226 =cut
227
228 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
224224 =back
225225
226226 =cut
227
228 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
224224 =back
225225
226226 =cut
227
228 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
224224 =back
225225
226226 =cut
227
228 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
224224 =back
225225
226226 =cut
227
228 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
224224 =back
225225
226226 =cut
227
228 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
224224 =back
225225
226226 =cut
227
228 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( chaes chaes_hex chaes_b64 chaes_b64u chaes_file chaes_file_hex chaes_file_b64 chaes_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md2 md2_hex md2_b64 md2_b64u md2_file md2_file_hex md2_file_b64 md2_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md4 md4_hex md4_b64 md4_b64u md4_file md4_file_hex md4_file_b64 md4_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( md5 md5_hex md5_b64 md5_b64u md5_file md5_file_hex md5_file_b64 md5_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd128 ripemd128_hex ripemd128_b64 ripemd128_b64u ripemd128_file ripemd128_file_hex ripemd128_file_b64 ripemd128_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd160 ripemd160_hex ripemd160_b64 ripemd160_b64u ripemd160_file ripemd160_file_hex ripemd160_file_b64 ripemd160_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd256 ripemd256_hex ripemd256_b64 ripemd256_b64u ripemd256_file ripemd256_file_hex ripemd256_file_b64 ripemd256_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( ripemd320 ripemd320_hex ripemd320_b64 ripemd320_b64u ripemd320_file ripemd320_file_hex ripemd320_file_b64 ripemd320_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha1 sha1_hex sha1_b64 sha1_b64u sha1_file sha1_file_hex sha1_file_b64 sha1_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha224 sha224_hex sha224_b64 sha224_b64u sha224_file sha224_file_hex sha224_file_b64 sha224_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha256 sha256_hex sha256_b64 sha256_b64u sha256_file sha256_file_hex sha256_file_b64 sha256_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha384 sha384_hex sha384_b64 sha384_b64u sha384_file sha384_file_hex sha384_file_b64 sha384_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( sha512 sha512_hex sha512_b64 sha512_b64u sha512_file sha512_file_hex sha512_file_b64 sha512_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 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 )] );
222222 =back
223223
224224 =cut
225
226 __END__
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use Carp;
77 $Carp::Internal{(__PACKAGE__)}++;
101101 =back
102102
103103 =cut
104
105 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( tiger192 tiger192_hex tiger192_b64 tiger192_b64u tiger192_file tiger192_file_hex tiger192_file_b64 tiger192_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Digest Exporter);
99 our %EXPORT_TAGS = ( all => [qw( whirlpool whirlpool_hex whirlpool_b64 whirlpool_b64u whirlpool_file whirlpool_file_hex whirlpool_file_b64 whirlpool_file_b64u )] );
222222 =back
223223
224224 =cut
225
226 __END__
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 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 )] );
175175
176176 =head1 FUNCTIONS
177177
178 Please note that all functions take as its first argument the algoritm name, supported values are:
178 Please note that all functions take as its first argument the algorithm name, supported values are:
179179
180180 'CHAES', 'MD2', 'MD4', 'MD5', 'RIPEMD128', 'RIPEMD160',
181181 'RIPEMD256', 'RIPEMD320', 'SHA1', 'SHA224', 'SHA256',
372372 =back
373373
374374 =cut
375
376 __END__
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw(pbkdf1 pbkdf2 hkdf hkdf_expand hkdf_extract)] );
6969
7070 =head1 NAME
7171
72 Crypt::KeyDerivation - PBKDF1, PBKFD2 and HKDF key derivation functions
72 Crypt::KeyDerivation - PBKDF1, PBKDF2 and HKDF key derivation functions
7373
7474 =head1 SYNOPSIS
7575
8888
8989 =over
9090
91 =item * PBKFD1 and PBKDF according to PKCS#5 v2.0 L<https://tools.ietf.org/html/rfc2898|https://tools.ietf.org/html/rfc2898>
91 =item * PBKDF1 and PBKDF according to PKCS#5 v2.0 L<https://tools.ietf.org/html/rfc2898|https://tools.ietf.org/html/rfc2898>
9292
9393 =item * HKDF (+ related) according to L<https://tools.ietf.org/html/rfc5869|https://tools.ietf.org/html/rfc5869>
9494
171171 # $hash_name .. optional, DEFAULT: 'SHA256'
172172 # $len ........ optional, derived key len, DEFAULT: 32
173173 # $info ....... optional context and application specific information, DEFAULT: ''
174
175 =cut
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2b blake2b_hex blake2b_b64 blake2b_b64u )] );
151151 =back
152152
153153 =cut
154
155 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( blake2s blake2s_hex blake2s_b64 blake2s_b64u )] );
151151 =back
152152
153153 =cut
154
155 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( f9 f9_hex f9_b64 f9_b64u )] );
151151 =back
152152
153153 =cut
154
155 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( hmac hmac_hex hmac_b64 hmac_b64u )] );
170170 =back
171171
172172 =cut
173
174 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( omac omac_hex omac_b64 omac_b64u )] );
153153 =back
154154
155155 =cut
156
157 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( pmac pmac_hex pmac_b64 pmac_b64u )] );
153153 =back
154154
155155 =cut
156
157 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( pelican pelican_hex pelican_b64 pelican_b64u )] );
151151 =back
152152
153153 =cut
154
155 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( poly1305 poly1305_hex poly1305_b64 poly1305_b64u )] );
151151 =back
152152
153153 =cut
154
155 __END__
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use base qw(Crypt::Mac Exporter);
99 our %EXPORT_TAGS = ( all => [qw( xcbc xcbc_hex xcbc_b64 xcbc_b64u )] );
153153 =back
154154
155155 =cut
156
157 __END__
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( mac mac_hex )] );
4949
5050 1;
5151
52 __END__
52 =pod
5353
5454 =head1 NAME
5555
5656 Crypt::Mac - [internal only]
5757
58 =cut
58 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 5.57 'import';
77 use Carp 'croak';
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use Crypt::Cipher;
99 use base 'Crypt::Mode';
114114 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher-block_chaining_.28CBC.29>
115115
116116 =back
117
118 =cut
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use Crypt::Cipher;
99 use base 'Crypt::Mode';
9191 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_feedback_.28CFB.29>
9292
9393 =back
94
95 =cut
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use Crypt::Cipher;
99 use base 'Crypt::Mode';
9898 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_.28CTR.29>
9999
100100 =back
101
102 =cut
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use Crypt::Cipher;
99 use base 'Crypt::Mode';
115115 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_.28ECB.29>
116116
117117 =back
118
119 =cut
33
44 use strict;
55 use warnings;
6 our $VERSION = '0.054_006';
6 our $VERSION = '0.055';
77
88 use Crypt::Cipher;
99 use base 'Crypt::Mode';
9191 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Output_feedback_.28OFB.29>
9292
9393 =back
94
95 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 ### METHODS
77
6262
6363 1;
6464
65 __END__
65 =pod
6666
6767 =head1 NAME
6868
6969 Crypt::Mode - [internal only]
7070
71 =cut
71 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( dh_shared_secret )] );
327327 random data taken from C</dev/random> (UNIX) or C<CryptGenRandom> (Win32).
328328
329329 $pk->generate_key($groupsize);
330 ### $groupsize (in bytes) corresponds to DH params (p, g) predefined by libtomcrypt
330 ### $groupsize (in bytes) corresponds to DH parameters (p, g) predefined by libtomcrypt
331331 # 96 => DH-768
332332 # 128 => DH-1024
333333 # 192 => DH-1536
355355 # where $g is the generator (base) in a hex string and $p is the prime in a hex string
356356
357357 $pk->generate_key(\$dh_param)
358 # $dh_param is the content of DER or PEM file with DH params
358 # $dh_param is the content of DER or PEM file with DH parameters
359359 # e.g. openssl dhparam 2048
360360
361361 =head2 import_key
378378
379379 =head2 export_key
380380
381 B<BEWARE:> DH key format change - since v0.049 it is compatible with libtocrypt 1.18.
381 B<BEWARE:> DH key format change - since v0.049 it is compatible with libtomcrypt 1.18.
382382
383383 my $private = $pk->export_key('private');
384384 #or
479479 =item * L<https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange|https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange>
480480
481481 =back
482
483 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( dsa_encrypt dsa_decrypt dsa_sign_message dsa_verify_message dsa_sign_hash dsa_verify_hash )] );
472472 =head2 size
473473
474474 my $size = $pk->size;
475 # returns key size in bytes or undef if no key loaded
475 # returns key size (length of the prime p) in bytes or undef if key not loaded
476
477 =head2 size_q
478
479 my $size = $pk->size_q;
480 # returns length of the prime q in bytes or undef if key not loaded
476481
477482 =head2 key2hash
478483
642647 =item * L<https://en.wikipedia.org/wiki/Digital_Signature_Algorithm|https://en.wikipedia.org/wiki/Digital_Signature_Algorithm>
643648
644649 =back
650
651 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw( ecc_encrypt ecc_decrypt ecc_sign_message ecc_verify_message ecc_sign_hash ecc_verify_hash ecc_shared_secret )] );
773773 #or
774774 $pk->generate_key($hashref_with_curve_params);
775775
776 The following pre-defined C<$curve_name> values are supported:
776 The following predefined C<$curve_name> values are supported:
777777
778778 # curves from http://www.ecc-brainpool.org/download/Domain-parameters.pdf
779779 'brainpoolp160r1'
10281028 my $public_der = $pk->export_key_der('public');
10291029
10301030 Since CryptX-0.36 C<export_key_der> can also export keys in a format
1031 that does not explicitely contain curve parameters but only curve OID.
1031 that does not explicitly contain curve parameters but only curve OID.
10321032
10331033 my $private_der = $pk->export_key_der('private_short');
10341034 #or
10411041 my $public_pem = $pk->export_key_pem('public');
10421042
10431043 Since CryptX-0.36 C<export_key_pem> can also export keys in a format
1044 that does not explicitely contain curve parameters but only curve OID.
1044 that does not explicitly contain curve parameters but only curve OID.
10451045
10461046 my $private_pem = $pk->export_key_pem('private_short');
10471047 #or
13941394 =item * L<https://en.wikipedia.org/wiki/ECDSA|https://en.wikipedia.org/wiki/ECDSA>
13951395
13961396 =back
1397
1398 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 require Exporter; our @ISA = qw(Exporter); ### use Exporter 'import';
77 our %EXPORT_TAGS = ( all => [qw(rsa_encrypt rsa_decrypt rsa_sign_message rsa_verify_message rsa_sign_hash rsa_verify_hash)] );
960960 =item * L<https://en.wikipedia.org/wiki/RSA_%28algorithm%29|https://en.wikipedia.org/wiki/RSA_%28algorithm%29>
961961
962962 =back
963
964 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use Carp;
77
2323
2424 1;
2525
26 __END__
26 =pod
2727
2828 =head1 NAME
2929
3030 Crypt::PK - [internal only]
3131
32 =cut
32 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
156156 =item * L<https://tools.ietf.org/html/rfc7539>
157157
158158 =back
159
160 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
157157 =item * L<https://en.wikipedia.org/wiki/Fortuna_%28PRNG%29|https://en.wikipedia.org/wiki/Fortuna_%28PRNG%29>
158158
159159 =back
160
161 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
156156 =item * L<https://en.wikipedia.org/wiki/RC4_cipher|https://en.wikipedia.org/wiki/RC4_cipher>
157157
158158 =back
159
160 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
156156 =item * L<https://en.wikipedia.org/wiki/SOBER-128|https://en.wikipedia.org/wiki/SOBER-128>
157157
158158 =back
159
160 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Crypt::PRNG Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
155155 =item * L<https://en.wikipedia.org/wiki/Yarrow_algorithm|https://en.wikipedia.org/wiki/Yarrow_algorithm>
156156
157157 =back
158
159 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Exporter);
77 our %EXPORT_TAGS = ( all => [qw(random_bytes random_bytes_hex random_bytes_b64 random_bytes_b64u random_string random_string_from rand irand)] );
192192 #or
193193 $n = rand($limit);
194194
195 Returns a random floating point number from range C<[0,1)> (if called without param) or C<[0,$limit)>.
195 Returns a random floating point number from range C<[0,1)> (if called without parameter) or C<[0,$limit)>.
196196
197197 =head2 irand
198198
199199 $i = irand;
200200
201 Returns a random unsigned 32bit integer - range 0 .. 0xFFFFFFFF.
201 Returns a random unsigned 32bit integer - range C<0 .. 0xFFFFFFFF>.
202202
203203 =head1 METHODS
204204
279279
280280 =head1 SEE ALSO
281281
282 L<Crypt::PRNG::Fortuna>, L<Crypt::PRNG::RC4>, L<Crypt::PRNG::Sober128>, L<Crypt::PRNG::Yarrow>
282 L<Crypt::PRNG::Fortuna>, L<Crypt::PRNG::RC4>, L<Crypt::PRNG::Sober128>, L<Crypt::PRNG::Yarrow>
283
284 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use CryptX;
77
11
22 use strict;
33 use warnings ;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use base qw(Exporter);
77 our @EXPORT_OK = qw();
5555 }
5656
5757 1;
58 __END__
58
59 =pod
5960
6061 =head1 NAME
6162
62 CryptX - Crypto toolkit (self-contained no external libraries needed)
63 CryptX - Cryptographic toolkit (self-contained, no external libraries needed)
6364
6465 =head1 DESCRIPTION
6566
6970
7071 =over
7172
72 =item * Ciphers - see L<Crypt::Cipher> and related modules
73 =item * Symmetric ciphers - see L<Crypt::Cipher> and related modules
7374
7475 L<Crypt::Cipher::AES>, L<Crypt::Cipher::Anubis>, L<Crypt::Cipher::Blowfish>, L<Crypt::Cipher::Camellia>, L<Crypt::Cipher::CAST5>, L<Crypt::Cipher::DES>,
7576 L<Crypt::Cipher::DES_EDE>, L<Crypt::Cipher::IDEA>, L<Crypt::Cipher::KASUMI>, L<Crypt::Cipher::Khazad>, L<Crypt::Cipher::MULTI2>, L<Crypt::Cipher::Noekeon>,
8384
8485 =item * Stream ciphers
8586
86 L<Crypt::Stream::RC4>, L<Crypt::Stream::ChaCha>, L<Crypt::Stream::Salsa20>, L<Crypt::Stream::Sober128>
87 L<Crypt::Stream::RC4>, L<Crypt::Stream::ChaCha>, L<Crypt::Stream::Salsa20>, L<Crypt::Stream::Sober128>, L<Crypt::Stream::Sosemanuk>
8788
8889 =item * Authenticated encryption modes
8990
9899 L<Crypt::Digest::SHA512>, L<Crypt::Digest::SHA512_224>, L<Crypt::Digest::SHA512_256>, L<Crypt::Digest::Tiger192>, L<Crypt::Digest::Whirlpool>,
99100 L<Crypt::Digest::SHA3_224>, L<Crypt::Digest::SHA3_256>, L<Crypt::Digest::SHA3_384>, L<Crypt::Digest::SHA3_512>, L<Crypt::Digest::SHAKE>
100101
102 =item * Checksums
103
104 L<Crypt::Checksum>, L<Crypt::Checksum::Adler32>, L<Crypt::Checksum::CRC32>
105
101106 =item * Message Authentication Codes
102107
103 L<Crypt::Mac::F9>, L<Crypt::Mac::HMAC>, L<Crypt::Mac::OMAC>, L<Crypt::Mac::Pelican>, L<Crypt::Mac::PMAC>, L<Crypt::Mac::XCBC>, L<Crypt::Mac::Poly1305>
108 L<Crypt::Mac::BLAKE2b>, L<Crypt::Mac::BLAKE2s>, L<Crypt::Mac::F9>, L<Crypt::Mac::HMAC>, L<Crypt::Mac::OMAC>,
109 L<Crypt::Mac::Pelican>, L<Crypt::Mac::PMAC>, L<Crypt::Mac::XCBC>, L<Crypt::Mac::Poly1305>
104110
105111 =item * Public key cryptography
106112
110116
111117 L<Crypt::PRNG>, L<Crypt::PRNG::Fortuna>, L<Crypt::PRNG::Yarrow>, L<Crypt::PRNG::RC4>, L<Crypt::PRNG::Sober128>, L<Crypt::PRNG::ChaCha20>
112118
113 =item * Key derivation functions - PBKDF1, PBKFD2 and HKDF
119 =item * Key derivation functions - PBKDF1, PBKDF2 and HKDF
114120
115121 L<Crypt::KeyDerivation>
116122
126132
127133 =head1 COPYRIGHT
128134
129 Copyright (c) 2013+ DCIT, a.s. L<http://www.dcit.cz> / Karel Miko
135 Copyright (c) 2013+ DCIT, a.s. L<http://www.dcit.cz> / Karel Miko
136
137 =cut
11
22 use strict;
33 use warnings;
4 our $VERSION = '0.054_006';
4 our $VERSION = '0.055';
55
66 use CryptX;
77
435435
436436 1;
437437
438 __END__
439
440438 =pod
441439
442440 =head1 NAME
1717 "sha3-224", /* name of hash */
1818 17, /* internal ID */
1919 28, /* Size of digest in octets */
20 128, /* Input block size in octets */
20 144, /* Input block size in octets */
2121 { 2,16,840,1,101,3,4,2,7 }, /* ASN.1 OID */
2222 9, /* Length OID */
2323 &sha3_224_init,
3232 "sha3-256", /* name of hash */
3333 18, /* internal ID */
3434 32, /* Size of digest in octets */
35 128, /* Input block size in octets */
35 136, /* Input block size in octets */
3636 { 2,16,840,1,101,3,4,2,8 }, /* ASN.1 OID */
3737 9, /* Length OID */
3838 &sha3_256_init,
4747 "sha3-384", /* name of hash */
4848 19, /* internal ID */
4949 48, /* Size of digest in octets */
50 128, /* Input block size in octets */
50 104, /* Input block size in octets */
5151 { 2,16,840,1,101,3,4,2,9 }, /* ASN.1 OID */
5252 9, /* Length OID */
5353 &sha3_384_init,
6262 "sha3-512", /* name of hash */
6363 20, /* internal ID */
6464 64, /* Size of digest in octets */
65 128, /* Input block size in octets */
65 72, /* Input block size in octets */
6666 { 2,16,840,1,101,3,4,2,10 }, /* ASN.1 OID */
6767 9, /* Length OID */
6868 &sha3_512_init,
2929 #define SCRYPT "1.18.0"
3030
3131 /* max size of either a cipher/hash block or symmetric key [largest of the two] */
32 #define MAXBLOCKSIZE 128
32 #define MAXBLOCKSIZE 144
3333
3434 /* descriptor table size */
3535 #define TAB_SIZE 32
55 plan skip_all => "File::Find not installed" unless eval { require File::Find };
66 plan tests => 1;
77
8
9 sub _read {
10 open my $fh, "<", shift;
11 binmode $fh;
12 return do { local $/; <$fh> };
13 }
14
15 my @err;
16 my $cryptx = _read("lib/CryptX.pm");
817 my @files;
918 File::Find::find({ wanted=>sub { push @files, $_ if /\.pm$/ }, no_chdir=>1 }, 'lib');
1019
1120 for my $m (sort @files) {
21 my $content = _read($m);
22 push @err, "ERROR: no newline at the end '$m'" unless $content =~ /\n$/s;
23 push @err, "ERROR: avoid __END__ '$m'" if $content =~ /__END__/s;
24 push @err, "ERROR: =pod ... =cut '$m'" unless $content =~ /=pod\n.*?=cut\n$/s;
25 push @err, "ERROR: trailing whitespace '$m'" if $content =~ / \n/s;
26 push @err, "ERROR: avoid tabs '$m'" if $content =~ /\t/s;
27 push @err, "ERROR: avoid CRLF '$m'" if $content =~ /\r/s;
1228 $m =~ s|[\\/]|::|g;
1329 $m =~ s|^lib::||;
1430 $m =~ s|\.pm$||;
15 eval "use $m; 1;" or die "ERROR: 'use $m' failed";
31 push @err, "ERROR: '$m' is missing in CryptX" unless $cryptx =~ /L<$m>/s || $m =~ /^(CryptX|Math::BigInt::LTM|Crypt::(PK|Mode|Mac|AuthEnc))$/;
32 eval "use $m; 1;" or push @err, "ERROR: 'use $m' failed";
1633 }
1734
35 my @others = ('CryptX.xs');
36 File::Find::find({ wanted=>sub { push @others, $_ if /\.inc$/ }, no_chdir=>1 }, 'inc');
37 File::Find::find({ wanted=>sub { push @others, $_ if /\.(t|pl)$/ }, no_chdir=>1 }, 't');
38
39 for my $m (sort @others) {
40 my $content = _read($m);
41 push @err, "ERROR: no newline at the end '$m'" unless $content =~ /\n$/s;
42 push @err, "ERROR: trailing whitespace '$m'" if $content =~ / \n/s;
43 push @err, "ERROR: avoid tabs '$m'" if $content =~ /\t/s;
44 push @err, "ERROR: avoid CRLF '$m'" if $content =~ /\r/s;
45 }
46
47 warn "$_\n" for (@err);
48 die if @err;
49
1850 ok 1, 'all done';
22
33 use Test::More;
44
5 plan skip_all => "set TEST_POD to enable this test (developer only!)" unless $ENV{TEST_POD};
56 plan skip_all => "File::Find not installed" unless eval { require File::Find };
67 plan skip_all => "Test::Pod not installed" unless eval { require Test::Pod };
78 plan tests => 102;
1112
1213 for my $m (sort @files) {
1314 Test::Pod::pod_file_ok( $m, "Valid POD in '$m'" );
14 }
15 }
0 use strict;
1 use warnings;
2
3 use Test::More;
4
5 plan skip_all => "set TEST_POD to enable this test (developer only!)" unless $ENV{TEST_POD};
6 plan skip_all => "File::Find not installed" unless eval { require File::Find };
7 plan skip_all => "Test::Pod::Spelling or Text::Aspell not installed" unless eval { require Test::Pod::Spelling; require Text::Aspell; };
8
9 Test::Pod::Spelling->import(
10 spelling => {
11 allow_words => [qw(
12 AES BLAKEb BLAKEs CPAN CRC ChaCha CryptX DCIT DER Diffie EAX ECCDH ECDH ECDSA Flickr HKDF JSON JWA JWK
13 Karel Miko OCB OCBv OID OMAC OO OpenSSL PBKDF PEM PKCS RIPEMD Rijndael SHA UUID RFC
14 decrypt decrypts interoperability cryptographically cryptographic octects
15 libtomcrypt libtommath
16 params paramshash irand perl endian zbase bumac bmac budigest bdigest md de
17 blakes_ blakeb_
18 XOR'ing XOR'ed
19 )]
20 },
21 );
22
23 plan tests => 102;
24
25 my @files;
26 File::Find::find({ wanted=>sub { push @files, $_ if /\.pm$/ }, no_chdir=>1 }, 'lib');
27
28 for my $m (sort @files) {
29 Test::Pod::Spelling::pod_file_spelling_ok( $m, "Spelling in '$m'" );
30 }
0 use strict;
1 use warnings;
2
3 use Test::More;
4
5 plan skip_all => "set TEST_POD to enable this test (developer only!)" unless $ENV{TEST_POD};
6 plan skip_all => "Pod::Coverage not installed" unless eval { require Pod::Coverage };
7 plan skip_all => "File::Find not installed" unless eval { require File::Find };
8 plan tests => 102;
9
10 my @files;
11 File::Find::find({ wanted=>sub { push @files, $_ if /\.pm$/ }, no_chdir=>1 }, 'lib');
12
13 my @err;
14 for my $m (sort @files) {
15 my $f = $m;
16 $m =~ s|[\\/]|::|g;
17 $m =~ s|^lib::||;
18 $m =~ s|\.pm$||;
19
20 my $pc;
21 if ($m eq 'Crypt::PK::DH') {
22 $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)$/] );
23 }
24 elsif ($m eq 'Math::BigInt::LTM') {
25 $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(STORABLE_thaw|STORABLE_freeze|api_version)$/] );
26 }
27 elsif ($m eq 'Crypt::Mode') {
28 $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(add|decrypt|encrypt|finish|new|start_decrypt|start_encrypt)$/] );
29 }
30 elsif ($m eq 'Crypt::Mac') {
31 $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(add|addfile)$/] );
32 }
33 elsif ($m eq 'Crypt::AuthEnc::OCB') {
34 $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(blocksize|aad_add)$/] );
35 }
36 elsif ($m eq 'Crypt::AuthEnc::EAX') {
37 $pc = Pod::Coverage->new(package => $m, pod_from => $f, trustme => [qr/^(header_add|aad_add)$/] );
38 }
39 else {
40 $pc = Pod::Coverage->new(package => $m, pod_from => $f);
41 }
42
43 my $c = $pc->coverage || 0;
44 my @u = $pc->uncovered;
45 ok(@u == 0, sprintf("$m score=%.2f naked=(" . join(" ", @u) . ")", $c));
46 }
4949 is(unpack('H*', $tag), "9e9cba5dd4939d0d8e2687c85c5d3b89", "ccm_encrypt_authenticate: tag (no header)");
5050 my $pt = ccm_decrypt_verify('AES', $key, $nonce, "", $ct, $tag);
5151 is($pt, "plain_halfplain_half", "ccm_decrypt_verify: plaintext (no header)");
52 }
52 }
66
77 sub do_test {
88 my %a = @_;
9
10 my $key = pack("H*", $a{key});
9
10 my $key = pack("H*", $a{key});
1111 my $nonce = pack("H*", $a{nonce});
1212 my $header = pack("H*", $a{header});
1313 my $plaintext = pack("H*", $a{plaintext});
1414 my $ciphertext = pack("H*", $a{ciphertext});
1515 my $tag = pack("H*", $a{tag});
16
16
1717 my ($ct3, $tag3) = ccm_encrypt_authenticate('AES', $key, $nonce, $header, length($tag), $plaintext);
1818 is(unpack('H*', $ct3), $a{ciphertext}, "enc: ciphertext");
1919 is(unpack('H*', $tag3), $a{tag}, "enc: tag");
3232 ciphertext=>'588c979a61c663d2f066d0c2c0f989806d5f6b61dac384',
3333 tag=>'17e8d12cfdf926e0',
3434 },
35
35
3636 #/* 13 byte nonce, 12 byte header, 19 byte pt */
3737 {
3838 key=>'c0c1c2c3c4c5c6c7c8c9cacbcccdcecf',
4242 ciphertext=>'a28c6865939a9a79faaa5c4c2a9d4a91cdac8c',
4343 tag=>'96c861b9c9e61ef1',
4444 },
45
45
4646 #/* supplied by Brian Gladman */
4747 {
4848 key=>'404142434445464748494a4b4c4d4e4f',
5252 ciphertext=>'7162015b',
5353 tag=>'4dac255d',
5454 },
55
55
5656 {
5757 key=>'c97c1f67ce371185514a8a19f2bdd52f',
5858 nonce=>'005030f1844408b5039776e70c',
6161 ciphertext=>'f3d0a2fe9a3dbf2342a643e43246e80c3c04d019',
6262 tag=>'7845ce0b16f97623',
6363 },
64 );
64 );
66
77 sub do_test {
88 my %a = @_;
9
10 my $key = pack("H*", $a{key});
9
10 my $key = pack("H*", $a{key});
1111 my $nonce = pack("H*", $a{nonce});
1212 my $header = pack("H*", $a{header});
1313 my $plaintext = pack("H*", $a{plaintext});
1414 my $ciphertext = pack("H*", $a{ciphertext});
1515 my $tag = pack("H*", $a{tag});
16
16
1717 # encrypt
1818 my $m1 = Crypt::AuthEnc::EAX->new("AES", $key, $nonce);
1919 $m1->header_add($header);
3838 is(unpack('H*', $tag3), $a{tag}, "enc: tag");
3939 my $pt3 = eax_decrypt_verify('AES', $key, $nonce, $header, $ciphertext, $tag);
4040 is(unpack('H*', $pt3), $a{plaintext}, "dec: plaintext");
41
41
4242 }
4343
4444 do_test(%$_) for (
7676 {
7777 #16, 16, 16, 32,
7878 key => '000102030405060708090a0b0c0d0e0f',
79 nonce => '000102030405060708090a0b0c0d0e0f',
79 nonce => '000102030405060708090a0b0c0d0e0f',
8080 header => '000102030405060708090a0b0c0d0e0f',
8181 plaintext => '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f',
8282 ciphertext => '29d878d1a3be857b6fb8c8ea5950a778331fbf2ccf33986f35e8cf121dcb30bc',
8686 {
8787 #16, 15, 14, 29,
8888 key => '000102030405060708090a0b0c0d0e0f',
89 nonce => '000102030405060708090a0b0c0d0e',
89 nonce => '000102030405060708090a0b0c0d0e',
9090 header => '000102030405060708090a0b0c0d',
9191 plaintext => '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c',
9292 ciphertext => 'dd25c754c5b17c5928b69b73155f7bb8888faf37091ad92c8a24db868b',
9393 tag => '0d1a14e52224ffd23a05fa02cdef52da',
9494 },
95
95
9696 #/* Vectors from Brian Gladman */
9797 {
9898 #16, 16, 8, 0,
121121 ciphertext => 'd851d5bae0',
122122 tag => '3a59f238a23e39199dc9266626c40f80',
123123 },
124 );
124 );
66
77 sub do_test {
88 my %a = @_;
9
10 my $key = pack("H*", $a{key});
9
10 my $key = pack("H*", $a{key});
1111 my $adata = pack("H*", $a{adata});
1212 my $iv = pack("H*", $a{iv});
1313 my $plaintext = pack("H*", $a{plaintext});
1414 my $ciphertext = pack("H*", $a{ciphertext});
1515 my $tag = pack("H*", $a{tag});
16
16
1717 # encrypt
1818 my $m1 = Crypt::AuthEnc::GCM->new("AES", $key);
1919 $m1->iv_add($iv);
4040 is(unpack('H*', $tag3), $a{tag}, "enc: tag");
4141 my $pt3 = gcm_decrypt_verify('AES', $key, $iv, $adata, $ciphertext, $tag);
4242 is(unpack('H*', $pt3), $a{plaintext}, "dec: plaintext");
43
43
4444 }
4545
4646 do_test(%$_) for (
5454 # ciphertext => '',
5555 # tag => '58e2fccefa7e3061367f1d57a4e7455a',
5656 # },
57
57
5858 #/* test case #2 */
5959 {
6060 key => '00000000000000000000000000000000',
6464 ciphertext => '0388dace60b6a392f328c2b971b2fe78',
6565 tag => 'ab6e47d42cec13bdf53a67b21257bddf',
6666 },
67
67
6868 #/* test case #3 */
6969 {
7070 key => 'feffe9928665731c6d6a8f9467308308',
7474 ciphertext => '42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f5985',
7575 tag => '4d5c2af327cd64a62cf35abd2ba6fab4',
7676 },
77
77
7878 #/* test case #4 */
7979 {
8080 key => 'feffe9928665731c6d6a8f9467308308',
8484 ciphertext => '42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091',
8585 tag => '5bc94fbc3221a5db94fae95ae7121a47',
8686 },
87
87
8888 #/* test case #5 */
8989 {
9090 key => 'feffe9928665731c6d6a8f9467308308',
9494 ciphertext => '61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c742373806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f4598',
9595 tag => '3612d2e79e3b0785561be14aaca2fccb',
9696 },
97
97
9898 #/* test case #6 */
9999 {
100100 key => 'feffe9928665731c6d6a8f9467308308',
104104 ciphertext => '8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca701e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5',
105105 tag => '619cc5aefffe0bfa462af43c1699d050',
106106 },
107
107
108108 #/* test case #46 from BG (catches the LTC bug of v1.15) */
109109 {
110110 key => '00000000000000000000000000000000',
114114 ciphertext => 'cbc8d2f15481a4cc7dd1e19aaa83de5678483ec359ae7dec2ab8d534e0906f4b4663faff58a8b2d733b845eef7c9b331e9e10eb2612c995feb1ac15a6286cce8b297a8',
115115 tag => '8d2d2a9372626f6bee8580276a6366bf',
116116 }
117 );
117 );
1111 chomp($l);
1212 next if $l =~ /^#/;
1313 $l =~ s/[\s\t]+/ /g;
14
14
1515 if ($l eq '') {
1616 next unless defined $d->{C};
1717 my $A = pack('H*', $d->{A});
2020 my $K = pack('H*', $d->{K});
2121 my $N = pack('H*', $d->{N});
2222 my $tag_len = $d->{T} * 1;
23
23
2424 { #ENCRYPT
2525 my $m = Crypt::AuthEnc::OCB->new('AES', $K, $N, $tag_len);
2626 $m->adata_add($A);
4747 $v =~ s/\s//g;
4848 $d->{$k} = $v;
4949 }
50
50
5151 }
5252
5353 #print $text;
172172 P: 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
173173 C: 1792A4E31E0755FB03E31B22116E6C2DDF9EFD6E33D536F1A0124B0A55BAE884ED93481529C76B6AD0C515F4D1CDD4FDAC4F02AA
174174
175 LAST_ITEM_PLACEHOLDER_DO_NOT_DELETE!!!
175 LAST_ITEM_PLACEHOLDER_DO_NOT_DELETE!!!
1414 my ($k, $v) = split /:/, $pair;
1515 $d->{$k} = $v;
1616 }
17
17
1818 my $c = Crypt::Cipher::AES->new(pack('H*',$d->{key}));
1919 my $result = pack('H*', $d->{pt});
2020 $result = $c->encrypt($result) for(1..$d->{iter});
1212 my ($k, $v) = split /:/, $pair;
1313 $d->{$k} = $v;
1414 }
15
15
1616 my $c = Crypt::Cipher::SEED->new(pack('H*',$d->{key}));
1717 my $result = pack('H*', $d->{pt});
1818 $result = $c->encrypt($result) for(1..$d->{iter});
2525 key=000000000000000000000000000000004000000000000000 ptext=00000000000000000000000000000000 ctext=53bd3e8475db67f72910b945bf8c768e
2626 key=000000000000000000000000000000010000000000000000 ptext=00000000000000000000000000000000 ctext=deab7388a6f1c61d41e25a0d88f062c4
2727 key=0000000000000000000000800000000000000000000000000000000000000000 ptext=00000000000000000000000000000000 ctext=ad4b018d50e3a28124a0a1259dc667d4
28 key=4000000000000000000000000000000000000000000000000000000000000000 ptext=00000000000000000000000000000000 ctext=eae1d405570174df7df2f9966d509159
28 key=4000000000000000000000000000000000000000000000000000000000000000 ptext=00000000000000000000000000000000 ctext=eae1d405570174df7df2f9966d509159
3131 my $size;
3232
3333 while (my $l = <DATA>) {
34 $l =~ s/[\r\n]*$//;
34 $l =~ s/[\r\n]*$//;
3535 $l =~ s/^[\s]*([^\s\r\n]+).*?/$1/;
3636 $l =~ s/\s+//g;
3737 my ($k, $v) = split /:/, $l;
5757 next unless $tv->{$n}->{$ks}->{$i};
5858 my $ct = Crypt::Cipher->new($N, $key)->encrypt($bytes);
5959 is(unpack('H*', $ct), lc($tv->{$n}->{$ks}->{$i}), "$N/$ks/$i");
60 $bytes = $ct;
60 $bytes = $ct;
6161 $key = substr($ct x 100, 0, $ks);
6262 }
6363 }
1111 use Crypt::Cipher;
1212
1313 while (my $l = <DATA>) {
14 $l =~ s/[\r\n]*$//;
14 $l =~ s/[\r\n]*$//;
1515 $l =~ s/^\s*([^\s\r\n]+).*?/$1/;
1616 $l =~ s/\s+//;
1717 next if !$l || $l =~ /^#/;
6262 die "UNKNOWN MODE '$mode'";
6363 }
6464 #warn "[$cipher|$mode, ".length($key).", ".length($iv).", ".length($pt).", ".length($ct).", ".length($flag)."]\n";
65 }
65 }
6666
6767 __DATA__
6868 #cipher:key:iv:plaintext:ciphertext:0/1(decrypt/encrypt)
119119 AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:F5D3D58503B9699DE785895A96FDBAAF
120120 AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:43B1CD7F598ECE23881B00E3ED030688
121121 AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:7B0C785E27E8AD3F8223207104725DD4
122 # ECB-AES192.Encrypt and ECB-AES192.Decrypt
122 # ECB-AES192.Encrypt and ECB-AES192.Decrypt
123123 AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:BD334F1D6E45F25FF712A214571FA5CC
124124 AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:974104846D0AD3AD7734ECB3ECEE4EEF
125125 AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:EF7AFD2270E2E60ADCE0BA2FACE6444E
126126 AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:9A4B41BA738D6C72FB16691603C18E0E
127 # ECB-AES256.Encrypt and ECB-AES256.Decrypt
127 # ECB-AES256.Encrypt and ECB-AES256.Decrypt
128128 AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:F3EED1BDB5D2A03C064B5A7E3DB181F8
129129 AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:591CCB10D410ED26DC5BA74A31362870
130130 AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:B6ED21B99CA6F4F9F153E7B1BEAFED1D
131131 AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:23304B7A39F9F3FF067D8D8F9E24ECC7
132132 # For all CBC encrypts and decrypts, the transformed sequence is
133133 # AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec
134 # CBC-AES128.Encrypt and CBC-AES128.Decrypt
134 # CBC-AES128.Encrypt and CBC-AES128.Decrypt
135135 AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D
136136 AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2
137137 AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516
138138 AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7
139 # CBC-AES192.Encrypt and CBC-AES192.Decrypt
139 # CBC-AES192.Encrypt and CBC-AES192.Decrypt
140140 AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8
141141 AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A
142142 AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0
143143 AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD
144 # CBC-AES256.Encrypt and CBC-AES256.Decrypt
144 # CBC-AES256.Encrypt and CBC-AES256.Decrypt
145145 AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6
146146 AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D
147147 AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461
149149 # We don't support CFB{1,8}-AESxxx.{En,De}crypt
150150 # For all CFB128 encrypts and decrypts, the transformed sequence is
151151 # AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec
152 # CFB128-AES128.Encrypt
152 # CFB128-AES128.Encrypt
153153 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1
154154 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1
155155 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1
156156 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1
157 # CFB128-AES128.Decrypt
157 # CFB128-AES128.Decrypt
158158 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0
159159 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0
160160 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0
169169 AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0
170170 AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0
171171 AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0
172 # CFB128-AES256.Encrypt
172 # CFB128-AES256.Encrypt
173173 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1
174174 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1
175175 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1
176176 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1
177 # CFB128-AES256.Decrypt
177 # CFB128-AES256.Decrypt
178178 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0
179179 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0
180180 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0
181181 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0
182182 # For all OFB encrypts and decrypts, the transformed sequence is
183183 # AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec
184 # OFB-AES128.Encrypt
185 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1
186 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1
187 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1
188 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1
189 # OFB-AES128.Decrypt
184 # OFB-AES128.Encrypt
185 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1
186 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1
187 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1
188 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1
189 # OFB-AES128.Decrypt
190190 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0
191191 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0
192192 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0
193193 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0
194 # OFB-AES192.Encrypt
195 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1
196 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1
197 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1
198 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1
199 # OFB-AES192.Decrypt
200 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0
201 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0
202 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0
203 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0
204 # OFB-AES256.Encrypt
194 # OFB-AES192.Encrypt
195 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1
196 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1
197 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1
198 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1
199 # OFB-AES192.Decrypt
200 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0
201 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0
202 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0
203 AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0
204 # OFB-AES256.Encrypt
205205 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1
206206 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1
207207 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1
208208 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1
209 # OFB-AES256.Decrypt
209 # OFB-AES256.Decrypt
210210 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0
211211 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0
212212 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0
262262 CAMELLIA-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:B22F3C36B72D31329EEE8ADDC2906C68:1
263263 CAMELLIA-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:2EDF1F3418D53B88841FC8985FB1ECF2:1
264264
265 # ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt
265 # ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt
266266 CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:432FC5DCD628115B7C388D770B270C96
267267 CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:0BE1F14023782A22E8384C5ABB7FAB2B
268268 CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:A0A1ABCD1893AB6FE0FE5B65DF5F8636
269269 CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:E61925E0D5DFAA9BB29F815B3076E51A
270270
271 # ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt
271 # ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt
272272 CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:CCCC6C4E138B45848514D48D0D3439D3
273273 CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:5713C62C14B2EC0F8393B6AFD6F5785A
274274 CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:B40ED2B60EB54D09D030CF511FEEF366
275275 CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:909DBD95799096748CB27357E73E1D26
276276
277 # ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt
277 # ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt
278278 CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:BEFD219B112FA00098919CD101C9CCFA
279279 CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:C91D3A8F1AEA08A9386CF4B66C0169EA
280280 CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:A623D711DC5F25A51BB8A80D56397D28
282282
283283 # For all CBC encrypts and decrypts, the transformed sequence is
284284 # CAMELLIA-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec
285 # CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt
285 # CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt
286286 CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:1607CF494B36BBF00DAEB0B503C831AB
287287 CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:1607CF494B36BBF00DAEB0B503C831AB:AE2D8A571E03AC9C9EB76FAC45AF8E51:A2F2CF671629EF7840C5A5DFB5074887
288288 CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:A2F2CF671629EF7840C5A5DFB5074887:30C81C46A35CE411E5FBC1191A0A52EF:0F06165008CF8B8B5A63586362543E54
289289 CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:36A84CDAFD5F9A85ADA0F0A993D6D577:F69F2445DF4F9B17AD2B417BE66C3710:74C64268CDB8B8FAF5B34E8AF3732980
290290
291 # CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt
291 # CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt
292292 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:2A4830AB5AC4A1A2405955FD2195CF93
293293 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2A4830AB5AC4A1A2405955FD2195CF93:AE2D8A571E03AC9C9EB76FAC45AF8E51:5D5A869BD14CE54264F892A6DD2EC3D5
294294 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:5D5A869BD14CE54264F892A6DD2EC3D5:30C81C46A35CE411E5FBC1191A0A52EF:37D359C3349836D884E310ADDF68C449
295295 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:37D359C3349836D884E310ADDF68C449:F69F2445DF4F9B17AD2B417BE66C3710:01FAAA930B4AB9916E9668E1428C6B08
296296
297 # CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt
297 # CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt
298298 CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:E6CFA35FC02B134A4D2C0B6737AC3EDA
299299 CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E6CFA35FC02B134A4D2C0B6737AC3EDA:AE2D8A571E03AC9C9EB76FAC45AF8E51:36CBEB73BD504B4070B1B7DE2B21EB50
300300 CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:36CBEB73BD504B4070B1B7DE2B21EB50:30C81C46A35CE411E5FBC1191A0A52EF:E31A6055297D96CA3330CDF1B1860A83
303303 # We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt
304304 # For all CFB128 encrypts and decrypts, the transformed sequence is
305305 # CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec
306 # CFB128-CAMELLIA128.Encrypt
306 # CFB128-CAMELLIA128.Encrypt
307307 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1
308308 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:1
309309 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:1
310310 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:1
311311
312 # CFB128-CAMELLIA128.Decrypt
312 # CFB128-CAMELLIA128.Decrypt
313313 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0
314314 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:0
315315 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:0
327327 CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:0
328328 CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:0
329329
330 # CFB128-CAMELLIA256.Encrypt
330 # CFB128-CAMELLIA256.Encrypt
331331 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1
332332 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:1
333333 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:1
334334 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:1
335335
336 # CFB128-CAMELLIA256.Decrypt
336 # CFB128-CAMELLIA256.Decrypt
337337 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0
338338 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:0
339339 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:0
341341
342342 # For all OFB encrypts and decrypts, the transformed sequence is
343343 # CAMELLIA-bits-OFB:key:IV/output':plaintext:ciphertext:encdec
344 # OFB-CAMELLIA128.Encrypt
344 # OFB-CAMELLIA128.Encrypt
345345 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1
346346 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:1
347347 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:1
348348 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:1
349349
350 # OFB-CAMELLIA128.Decrypt
350 # OFB-CAMELLIA128.Decrypt
351351 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0
352352 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:0
353353 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:0
354354 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:0
355355
356 # OFB-CAMELLIA192.Encrypt
356 # OFB-CAMELLIA192.Encrypt
357357 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1
358358 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:1
359359 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:1
360360 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:1
361361
362 # OFB-CAMELLIA192.Decrypt
362 # OFB-CAMELLIA192.Decrypt
363363 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0
364364 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:0
365365 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:0
366366 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:0
367367
368 # OFB-CAMELLIA256.Encrypt
368 # OFB-CAMELLIA256.Encrypt
369369 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1
370370 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:1
371371 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:1
372372 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:1
373373
374 # OFB-CAMELLIA256.Decrypt
374 # OFB-CAMELLIA256.Decrypt
375375 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0
376376 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:0
377377 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:0
385385 SEED-ECB:00000000000000000000000000000000::000102030405060708090A0B0C0D0E0F:5EBAC6E0054E166819AFF1CC6D346CDB:1
386386 SEED-ECB:000102030405060708090A0B0C0D0E0F::00000000000000000000000000000000:C11F22F20140505084483597E4370F43:1
387387 SEED-ECB:4706480851E61BE85D74BFB3FD956185::83A2F8A288641FB9A4E9A5CC2F131C7D:EE54D13EBCAE706D226BC3142CD40D4A:1
388 SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:1
388 SEED-ECB:28DBC3BC49FFD87DCFA509B11D422BE7::B41E6BE2EBA84A148E2EED84593C5EC7:9B9B7BFCD1813CB95D0B3618F40F5122:1
1212 my ($k, $v) = split /:/, $pair;
1313 $d->{$k} = $v;
1414 }
15
15
1616 my $c = Crypt::Cipher::Twofish->new(pack('H*',$d->{key}));
1717 my $result = pack('H*', $d->{pt});
1818 $result = $c->encrypt($result) for(1..$d->{iter});
1212 my ($k, $v) = split /:/, $pair;
1313 $d->{$k} = $v;
1414 }
15
15
1616 my $c = Crypt::Cipher::XTEA->new(pack('H*',$d->{key}));
1717 my $result = pack('H*', $d->{pt});
1818 $result = $c->encrypt($result) for(1..$d->{iter});
141141 is(unpack("H*", decode_b32b(encode_b32b($b))), $h);
142142 is(unpack("H*", decode_b32z(encode_b32z($b))), $h);
143143 is(unpack("H*", decode_b32c(encode_b32c($b))), $h);
144 }
144 }
2222 my $hash;
2323
2424 while (my $l = <DATA>) {
25 $l =~ s/[\r\n]*$//;
25 $l =~ s/[\r\n]*$//;
2626 $l =~ s/^[\s]*([^\s\r\n]+).*?/$1/;
2727 $l =~ s/\s+//;
2828 my ($k, $v) = split /:/, $l;
1212 my $expected_prk = "077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e5";
1313 my $expected_okm = "3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf34007208d5b887185865";
1414
15 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
15 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
1616 my $okm1 = hkdf_expand($prk, $hash_name, $len, $info);
1717 my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info);
1818 is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/1");
2929 my $expected_prk = "06a6b88c5853361a06104c9ceb35b45cef760014904671014a193f40c15fc244";
3030 my $expected_okm = "b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71cc30c58179ec3e87c14c01d5c1f3434f1d87";
3131
32 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
32 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
3333 my $okm1 = hkdf_expand($prk, $hash_name, $len, $info);
3434 my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info);
3535 is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/2");
4646 my $expected_prk = "19ef24a32c717b167f33a91d6f648bdf96596776afdb6377ac434c1c293ccb04";
4747 my $expected_okm = "8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d9d201395faa4b61a96c8";
4848
49 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
49 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
5050 my $okm1 = hkdf_expand($prk, $hash_name, $len, $info);
5151 my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info);
5252 is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/3");
6363 my $expected_prk = "9b6c18c432a7bf8f0e71c8eb88f4b30baa2ba243";
6464 my $expected_okm = "085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f155fda2c22e422478d305f3f896";
6565
66 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
66 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
6767 my $okm1 = hkdf_expand($prk, $hash_name, $len, $info);
6868 my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info);
6969 is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/4");
8080 my $expected_prk = "8adae09a2a307059478d309b26c4115a224cfaf6";
8181 my $expected_okm = "0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e927336d0441f4c4300e2cff0d0900b52d3b4";
8282
83 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
83 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
8484 my $okm1 = hkdf_expand($prk, $hash_name, $len, $info);
8585 my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info);
8686 is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/5");
9797 my $expected_prk = "da8c8a73c7fa77288ec6f5e7c297786aa0d32d01";
9898 my $expected_okm = "0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0ea00033de03984d34918";
9999
100 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
100 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
101101 my $okm1 = hkdf_expand($prk, $hash_name, $len, $info);
102102 my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info);
103103 is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/6");
114114 my $expected_prk = "2adccada18779e7c2077ad2eb19d3f3e731385dd";
115115 my $expected_okm = "2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5673a081d70cce7acfc48";
116116
117 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
117 my $prk = hkdf_extract($keying_material, $salt, $hash_name);
118118 my $okm1 = hkdf_expand($prk, $hash_name, $len, $info);
119119 my $okm2 = hkdf($keying_material, $salt, $hash_name, $len, $info);
120120 is(unpack("H*", $prk), $expected_prk, "PRK hkdf_extract/7");
0 use strict;
1 use warnings;
2
3 use Test::More tests => 36;
4
5 use Crypt::Mac::HMAC 'hmac_hex';
6
7 # test vectors from https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/example-values#aMsgAuth
8
9 # https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA3-224.pdf
10 {
11 my $input = "Sample message for keylen<blocklen";
12 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b");
13 is( hmac_hex('SHA3_224', $key, $input), '332cfd59347fdb8e576e77260be4aba2d6dc53117b3bfb52c6d18c04', 'SHA3_224');
14 }
15 {
16 my $input = "Sample message for keylen=blocklen";
17 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f");
18 is( hmac_hex('SHA3_224', $key, $input), 'd8b733bcf66c644a12323d564e24dcf3fc75f231f3b67968359100c7', 'SHA3_224');
19 }
20 {
21 my $input = "Sample message for keylen>blocklen";
22 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaab");
23 is( hmac_hex('SHA3_224', $key, $input), '078695eecc227c636ad31d063a15dd05a7e819a66ec6d8de1e193e59', 'SHA3_224');
24 }
25 {
26 my $input = "Sample message for keylen<blocklen, with truncated tag";
27 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b");
28 is( substr(hmac_hex('SHA3_224', $key, $input), 0, 28), '8569c54cbb00a9b78ff1b391b0e5', 'SHA3_224');
29 }
30
31 # https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA3-256.pdf
32 {
33 my $input = "Sample message for keylen<blocklen";
34 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f");
35 is( hmac_hex('SHA3_256', $key, $input), '4fe8e202c4f058e8dddc23d8c34e467343e23555e24fc2f025d598f558f67205', 'SHA3_256');
36 }
37 {
38 my $input = "Sample message for keylen=blocklen";
39 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f8081828384858687");
40 is( hmac_hex('SHA3_256', $key, $input), '68b94e2e538a9be4103bebb5aa016d47961d4d1aa906061313b557f8af2c3faa', 'SHA3_256');
41 }
42 {
43 my $input = "Sample message for keylen>blocklen";
44 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7");
45 is( hmac_hex('SHA3_256', $key, $input), '9bcf2c238e235c3ce88404e813bd2f3a97185ac6f238c63d6229a00b07974258', 'SHA3_256');
46 }
47 {
48 my $input = "Sample message for keylen<blocklen, with truncated tag";
49 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f");
50 is( substr(hmac_hex('SHA3_256', $key, $input), 0, 32), 'c8dc7148d8c1423aa549105dafdf9cad', 'SHA3_256');
51 }
52
53 # https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA3-384.pdf
54 {
55 my $input = "Sample message for keylen<blocklen";
56 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f");
57 is( hmac_hex('SHA3_384', $key, $input), 'd588a3c51f3f2d906e8298c1199aa8ff6296218127f6b38a90b6afe2c5617725bc99987f79b22a557b6520db710b7f42', 'SHA3_384');
58 }
59 {
60 my $input = "Sample message for keylen=blocklen";
61 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f6061626364656667");
62 is( hmac_hex('SHA3_384', $key, $input), 'a27d24b592e8c8cbf6d4ce6fc5bf62d8fc98bf2d486640d9eb8099e24047837f5f3bffbe92dcce90b4ed5b1e7e44fa90', 'SHA3_384');
63 }
64 {
65 my $input = "Sample message for keylen>blocklen";
66 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f9091929394959697");
67 is( hmac_hex('SHA3_384', $key, $input), 'e5ae4c739f455279368ebf36d4f5354c95aa184c899d3870e460ebc288ef1f9470053f73f7c6da2a71bcaec38ce7d6ac', 'SHA3_384');
68 }
69 {
70 my $input = "Sample message for keylen<blocklen, with truncated tag";
71 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f");
72 is( substr(hmac_hex('SHA3_384', $key, $input), 0, 48), '25f4bf53606e91af79d24a4bb1fd6aecd44414a30c8ebb0a', 'SHA3_384');
73 }
74
75 # https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA3-512.pdf
76 {
77 my $input = "Sample message for keylen<blocklen";
78 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f");
79 is( hmac_hex('SHA3_512', $key, $input), '4efd629d6c71bf86162658f29943b1c308ce27cdfa6db0d9c3ce81763f9cbce5f7ebe9868031db1a8f8eb7b6b95e5c5e3f657a8996c86a2f6527e307f0213196', 'SHA3_512');
80 }
81 {
82 my $input = "Sample message for keylen=blocklen";
83 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f4041424344454647");
84 is( hmac_hex('SHA3_512', $key, $input), '544e257ea2a3e5ea19a590e6a24b724ce6327757723fe2751b75bf007d80f6b360744bf1b7a88ea585f9765b47911976d3191cf83c039f5ffab0d29cc9d9b6da', 'SHA3_512');
85 }
86 {
87 my $input = "Sample message for keylen>blocklen";
88 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f8081828384858687");
89 is( hmac_hex('SHA3_512', $key, $input), '5f464f5e5b7848e3885e49b2c385f0694985d0e38966242dc4a5fe3fea4b37d46b65ceced5dcf59438dd840bab22269f0ba7febdb9fcf74602a35666b2a32915', 'SHA3_512');
90 }
91 {
92 my $input = "Sample message for keylen<blocklen, with truncated tag";
93 my $key = pack("H*", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f");
94 is( substr(hmac_hex('SHA3_512', $key, $input), 0, 64), '7bb06d859257b25ce73ca700df34c5cbef5c898bac91029e0b27975d4e526a08', 'SHA3_512');
95 }
96
97 # https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA1.pdf
98 {
99 my $input = "Sample message for keylen=blocklen";
100 my $key = pack("H*", "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F");
101 is( hmac_hex('SHA1', $key, $input), '5fd596ee78d5553c8ff4e72d266dfd192366da29', 'SHA1');
102 }
103 {
104 my $input = "Sample message for keylen<blocklen";
105 my $key = pack("H*", "000102030405060708090A0B0C0D0E0F10111213");
106 is( hmac_hex('SHA1', $key, $input), '4c99ff0cb1b31bd33f8431dbaf4d17fcd356a807', 'SHA1');
107 }
108 {
109 my $input = "Sample message for keylen=blocklen";
110 my $key = pack("H*", "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60616263");
111 is( hmac_hex('SHA1', $key, $input), '2d51b2f7750e410584662e38f133435f4c4fd42a', 'SHA1');
112 }
113 {
114 my $input = "Sample message for keylen<blocklen, with truncated tag";
115 my $key = pack("H*", "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F30");
116 is( substr(hmac_hex('SHA1', $key, $input), 0, 24), 'fe3529565cd8e28c5fa79eac', 'SHA1');
117 }
118
119 # https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA224.pdf
120 {
121 my $input = "Sample message for keylen=blocklen";
122 my $key = pack("H*", "000102030405060708090A0B