Codebase list libcryptx-perl / 4530ff6
POD fixes, spelling Karel Miko 6 years ago
103 changed file(s) with 131 addition(s) and 176 deletion(s). Raw diff Collapse all Expand all
192192 =item * L<[%v%]>
193193 [% END %]
194194 =back
195
196 =cut
3131 spec_rounds=>0, spec_key=>'XXX-DETERMINED-BY-KEYSIZE' }, # 12 (<=80bits), 16 (>80bits)
3232 DES => { info=>'Symmetric cipher DES, key size: 64[56] bits (Crypt::CBC compliant)', urls=>['https://en.wikipedia.org/wiki/Data_Encryption_Standard'],
3333 spec_rounds=>0, spec_key=>'XXX-ROUNDS-FIXED' },
34 DES_EDE => { info=>'Symmetric cipher DES_EDE (aka Tripple-DES, 3DES), key size: 192[168] bits (Crypt::CBC compliant)', urls=>['https://en.wikipedia.org/wiki/Triple_DES'],
34 DES_EDE => { info=>'Symmetric cipher DES_EDE (aka Triple-DES, 3DES), key size: 192[168] bits (Crypt::CBC compliant)', urls=>['https://en.wikipedia.org/wiki/Triple_DES'],
3535 spec_rounds=>0, spec_key=>'XXX-ROUNDS-FIXED' },
3636 KASUMI => { info=>'Symmetric cipher KASUMI, key size: 128 bits (Crypt::CBC compliant)', urls=>['https://en.wikipedia.org/wiki/KASUMI_(block_cipher)'],
3737 spec_rounds=>0, spec_key=>'XXX-ROUNDS-FIXED' },
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
174174 =item * L<https://tools.ietf.org/html/rfc7539>
175175
176176 =back
177
178 =cut
182182 =item * L<https://en.wikipedia.org/wiki/EAX_mode|https://en.wikipedia.org/wiki/EAX_mode>
183183
184184 =back
185
186 =cut
183183 =item * L<https://en.wikipedia.org/wiki/Galois/Counter_Mode>
184184
185185 =back
186
187 =cut
184184
185185 =item * L<https://tools.ietf.org/html/rfc7253>
186186
187 =back
187 =back
188
189 =cut
77
88 1;
99
10 __END__
10 =pod
1111
1212 =head1 NAME
1313
1414 Crypt::AuthEnc - [internal only]
1515
16 =cut
16 =cut
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
2020
2121 =head1 NAME
2222
23 Crypt::Cipher::DES_EDE - Symmetric 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__
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
4949
5050 1;
5151
52 __END__
52 =pod
5353
5454 =head1 NAME
5555
5656 Crypt::Mac - [internal only]
5757
58 =cut
58 =cut
114114 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher-block_chaining_.28CBC.29>
115115
116116 =back
117
118 =cut
9191 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher_feedback_.28CFB.29>
9292
9393 =back
94
95 =cut
9898 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_.28CTR.29>
9999
100100 =back
101
102 =cut
115115 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Electronic_codebook_.28ECB.29>
116116
117117 =back
118
119 =cut
9191 =item * L<https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Output_feedback_.28OFB.29>
9292
9393 =back
94
95 =cut
6262
6363 1;
6464
65 __END__
65 =pod
6666
6767 =head1 NAME
6868
6969 Crypt::Mode - [internal only]
7070
71 =cut
71 =cut
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
642642 =item * L<https://en.wikipedia.org/wiki/Digital_Signature_Algorithm|https://en.wikipedia.org/wiki/Digital_Signature_Algorithm>
643643
644644 =back
645
646 =cut
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'
13941394 =item * L<https://en.wikipedia.org/wiki/ECDSA|https://en.wikipedia.org/wiki/ECDSA>
13951395
13961396 =back
1397
1398 =cut
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
2323
2424 1;
2525
26 __END__
26 =pod
2727
2828 =head1 NAME
2929
3030 Crypt::PK - [internal only]
3131
32 =cut
32 =cut
156156 =item * L<https://tools.ietf.org/html/rfc7539>
157157
158158 =back
159
160 =cut
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
156156 =item * L<https://en.wikipedia.org/wiki/RC4_cipher|https://en.wikipedia.org/wiki/RC4_cipher>
157157
158158 =back
159
160 =cut
156156 =item * L<https://en.wikipedia.org/wiki/SOBER-128|https://en.wikipedia.org/wiki/SOBER-128>
157157
158158 =back
159
160 =cut
155155 =item * L<https://en.wikipedia.org/wiki/Yarrow_algorithm|https://en.wikipedia.org/wiki/Yarrow_algorithm>
156156
157157 =back
158
159 =cut
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
5555 }
5656
5757 1;
58 __END__
58
59 =pod
5960
6061 =head1 NAME
6162
114115
115116 L<Crypt::PRNG>, L<Crypt::PRNG::Fortuna>, L<Crypt::PRNG::Yarrow>, L<Crypt::PRNG::RC4>, L<Crypt::PRNG::Sober128>, L<Crypt::PRNG::ChaCha20>
116117
117 =item * Key derivation functions - PBKDF1, PBKFD2 and HKDF
118 =item * Key derivation functions - PBKDF1, PBKDF2 and HKDF
118119
119120 L<Crypt::KeyDerivation>
120121
130131
131132 =head1 COPYRIGHT
132133
133 Copyright (c) 2013+ DCIT, a.s. L<http://www.dcit.cz> / Karel Miko
134 Copyright (c) 2013+ DCIT, a.s. L<http://www.dcit.cz> / Karel Miko
135
136 =cut
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
815 my @files;
916 File::Find::find({ wanted=>sub { push @files, $_ if /\.pm$/ }, no_chdir=>1 }, 'lib');
1017
18 my @err;
1119 for my $m (sort @files) {
20 my $content = _read($m);
21 push @err, "ERROR: no newline at the end '$m'" unless $content =~ /\n$/s;
22 push @err, "ERROR: avoid __END__ '$m'" if $content =~ /__END__/s;
23 push @err, "ERROR: =pod ... =cut '$m'" unless $content =~ /=pod\n.*?=cut\n$/s;
24 push @err, "ERROR: trailing whitespace '$m'" if $content =~ / \n/s;
25 push @err, "ERROR: avoid tabs '$m'" if $content =~ /\t/s;
26 push @err, "ERROR: avoid CRLF '$m'" if $content =~ /\r/s;
1227 $m =~ s|[\\/]|::|g;
1328 $m =~ s|^lib::||;
1429 $m =~ s|\.pm$||;
15 eval "use $m; 1;" or die "ERROR: 'use $m' failed";
30 eval "use $m; 1;" or push @err, "ERROR: 'use $m' failed";
1631 }
1732
33 warn "$_\n" for (@err);
34 die if @err;
35
1836 ok 1, 'all done';
0 use strict;
1 use warnings;
2
3 use Test::More;
4
5 plan skip_all => "File::Find not installed" unless eval { require File::Find };
6 plan skip_all => "Test::Pod::Spelling or Text::Aspell not installed" unless eval { require Test::Pod::Spelling; require Text::Aspell; };
7
8 Test::Pod::Spelling->import(
9 spelling => {
10 allow_words => [qw(
11 AES BLAKEb BLAKEs CPAN CRC ChaCha CryptX DCIT DER Diffie EAX ECCDH ECDH ECDSA Flickr HKDF JSON JWA JWK
12 Karel Miko OCB OCBv OID OMAC OO OpenSSL PBKDF PEM PKCS RIPEMD Rijndael SHA UUID RFC
13 decrypt decrypts interoperability cryptographically cryptographic octects
14 libtomcrypt libtommath
15 params paramshash irand perl endian zbase bumac bmac budigest bdigest md de
16 blakes_ blakeb_
17 XOR'ing XOR'ed
18 )]
19 },
20 );
21
22 plan tests => 102;
23
24 my @files;
25 File::Find::find({ wanted=>sub { push @files, $_ if /\.pm$/ }, no_chdir=>1 }, 'lib');
26
27 for my $m (sort @files) {
28 Test::Pod::Spelling::pod_file_spelling_ok( $m, "Spelling in '$m'" );
29 }