line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Digest::RIPEMD320; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
### BEWARE - GENERATED FILE, DO NOT EDIT MANUALLY! |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
867
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
50
|
|
6
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
67
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.079_007'; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
10
|
use base qw(Crypt::Digest Exporter); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
381
|
|
10
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( all => [qw( ripemd320 ripemd320_hex ripemd320_b64 ripemd320_b64u ripemd320_file ripemd320_file_hex ripemd320_file_b64 ripemd320_file_b64u )] ); |
11
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
12
|
|
|
|
|
|
|
our @EXPORT = qw(); |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
14
|
use Carp; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
123
|
|
15
|
|
|
|
|
|
|
$Carp::Internal{(__PACKAGE__)}++; |
16
|
2
|
|
|
2
|
|
11
|
use Crypt::Digest; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
540
|
|
17
|
|
|
|
|
|
|
|
18
|
2
|
|
|
2
|
1
|
1442
|
sub hashsize { Crypt::Digest::hashsize('RIPEMD320') } |
19
|
4
|
|
|
4
|
1
|
42
|
sub ripemd320 { Crypt::Digest::digest_data('RIPEMD320', @_) } |
20
|
4
|
|
|
4
|
1
|
39
|
sub ripemd320_hex { Crypt::Digest::digest_data_hex('RIPEMD320', @_) } |
21
|
4
|
|
|
4
|
1
|
38
|
sub ripemd320_b64 { Crypt::Digest::digest_data_b64('RIPEMD320', @_) } |
22
|
1
|
|
|
1
|
1
|
11
|
sub ripemd320_b64u { Crypt::Digest::digest_data_b64u('RIPEMD320', @_) } |
23
|
4
|
|
|
4
|
1
|
14
|
sub ripemd320_file { Crypt::Digest::digest_file('RIPEMD320', @_) } |
24
|
4
|
|
|
4
|
1
|
14
|
sub ripemd320_file_hex { Crypt::Digest::digest_file_hex('RIPEMD320', @_) } |
25
|
4
|
|
|
4
|
1
|
14
|
sub ripemd320_file_b64 { Crypt::Digest::digest_file_b64('RIPEMD320', @_) } |
26
|
0
|
|
|
0
|
1
|
|
sub ripemd320_file_b64u { Crypt::Digest::digest_file_b64u('RIPEMD320', @_) } |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=pod |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Crypt::Digest::RIPEMD320 - Hash function RIPEMD-320 [size: 320 bits] |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 SYNOPSIS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
### Functional interface: |
39
|
|
|
|
|
|
|
use Crypt::Digest::RIPEMD320 qw( ripemd320 ripemd320_hex ripemd320_b64 ripemd320_b64u |
40
|
|
|
|
|
|
|
ripemd320_file ripemd320_file_hex ripemd320_file_b64 ripemd320_file_b64u ); |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
# calculate digest from string/buffer |
43
|
|
|
|
|
|
|
$ripemd320_raw = ripemd320('data string'); |
44
|
|
|
|
|
|
|
$ripemd320_hex = ripemd320_hex('data string'); |
45
|
|
|
|
|
|
|
$ripemd320_b64 = ripemd320_b64('data string'); |
46
|
|
|
|
|
|
|
$ripemd320_b64u = ripemd320_b64u('data string'); |
47
|
|
|
|
|
|
|
# calculate digest from file |
48
|
|
|
|
|
|
|
$ripemd320_raw = ripemd320_file('filename.dat'); |
49
|
|
|
|
|
|
|
$ripemd320_hex = ripemd320_file_hex('filename.dat'); |
50
|
|
|
|
|
|
|
$ripemd320_b64 = ripemd320_file_b64('filename.dat'); |
51
|
|
|
|
|
|
|
$ripemd320_b64u = ripemd320_file_b64u('filename.dat'); |
52
|
|
|
|
|
|
|
# calculate digest from filehandle |
53
|
|
|
|
|
|
|
$ripemd320_raw = ripemd320_file(*FILEHANDLE); |
54
|
|
|
|
|
|
|
$ripemd320_hex = ripemd320_file_hex(*FILEHANDLE); |
55
|
|
|
|
|
|
|
$ripemd320_b64 = ripemd320_file_b64(*FILEHANDLE); |
56
|
|
|
|
|
|
|
$ripemd320_b64u = ripemd320_file_b64u(*FILEHANDLE); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
### OO interface: |
59
|
|
|
|
|
|
|
use Crypt::Digest::RIPEMD320; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
$d = Crypt::Digest::RIPEMD320->new; |
62
|
|
|
|
|
|
|
$d->add('any data'); |
63
|
|
|
|
|
|
|
$d->addfile('filename.dat'); |
64
|
|
|
|
|
|
|
$d->addfile(*FILEHANDLE); |
65
|
|
|
|
|
|
|
$result_raw = $d->digest; # raw bytes |
66
|
|
|
|
|
|
|
$result_hex = $d->hexdigest; # hexadecimal form |
67
|
|
|
|
|
|
|
$result_b64 = $d->b64digest; # Base64 form |
68
|
|
|
|
|
|
|
$result_b64u = $d->b64udigest; # Base64 URL Safe form |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 DESCRIPTION |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Provides an interface to the RIPEMD320 digest algorithm. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 EXPORT |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Nothing is exported by default. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
You can export selected functions: |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
use Crypt::Digest::RIPEMD320 qw(ripemd320 ripemd320_hex ripemd320_b64 ripemd320_b64u |
81
|
|
|
|
|
|
|
ripemd320_file ripemd320_file_hex ripemd320_file_b64 ripemd320_file_b64u); |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Or all of them at once: |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
use Crypt::Digest::RIPEMD320 ':all'; |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 FUNCTIONS |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 ripemd320 |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Logically joins all arguments into a single string, and returns its RIPEMD320 digest encoded as a binary string. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
$ripemd320_raw = ripemd320('data string'); |
94
|
|
|
|
|
|
|
#or |
95
|
|
|
|
|
|
|
$ripemd320_raw = ripemd320('any data', 'more data', 'even more data'); |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 ripemd320_hex |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Logically joins all arguments into a single string, and returns its RIPEMD320 digest encoded as a hexadecimal string. |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
$ripemd320_hex = ripemd320_hex('data string'); |
102
|
|
|
|
|
|
|
#or |
103
|
|
|
|
|
|
|
$ripemd320_hex = ripemd320_hex('any data', 'more data', 'even more data'); |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 ripemd320_b64 |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Logically joins all arguments into a single string, and returns its RIPEMD320 digest encoded as a Base64 string, B trailing '=' padding. |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
$ripemd320_b64 = ripemd320_b64('data string'); |
110
|
|
|
|
|
|
|
#or |
111
|
|
|
|
|
|
|
$ripemd320_b64 = ripemd320_b64('any data', 'more data', 'even more data'); |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head2 ripemd320_b64u |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
Logically joins all arguments into a single string, and returns its RIPEMD320 digest encoded as a Base64 URL Safe string (see RFC 4648 section 5). |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
$ripemd320_b64url = ripemd320_b64u('data string'); |
118
|
|
|
|
|
|
|
#or |
119
|
|
|
|
|
|
|
$ripemd320_b64url = ripemd320_b64u('any data', 'more data', 'even more data'); |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=head2 ripemd320_file |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
Reads file (defined by filename or filehandle) content, and returns its RIPEMD320 digest encoded as a binary string. |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
$ripemd320_raw = ripemd320_file('filename.dat'); |
126
|
|
|
|
|
|
|
#or |
127
|
|
|
|
|
|
|
$ripemd320_raw = ripemd320_file(*FILEHANDLE); |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
=head2 ripemd320_file_hex |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
Reads file (defined by filename or filehandle) content, and returns its RIPEMD320 digest encoded as a hexadecimal string. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
$ripemd320_hex = ripemd320_file_hex('filename.dat'); |
134
|
|
|
|
|
|
|
#or |
135
|
|
|
|
|
|
|
$ripemd320_hex = ripemd320_file_hex(*FILEHANDLE); |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
B You have to make sure that the filehandle is in binary mode before you pass it as argument to the addfile() method. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 ripemd320_file_b64 |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Reads file (defined by filename or filehandle) content, and returns its RIPEMD320 digest encoded as a Base64 string, B trailing '=' padding. |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
$ripemd320_b64 = ripemd320_file_b64('filename.dat'); |
144
|
|
|
|
|
|
|
#or |
145
|
|
|
|
|
|
|
$ripemd320_b64 = ripemd320_file_b64(*FILEHANDLE); |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head2 ripemd320_file_b64u |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Reads file (defined by filename or filehandle) content, and returns its RIPEMD320 digest encoded as a Base64 URL Safe string (see RFC 4648 section 5). |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
$ripemd320_b64url = ripemd320_file_b64u('filename.dat'); |
152
|
|
|
|
|
|
|
#or |
153
|
|
|
|
|
|
|
$ripemd320_b64url = ripemd320_file_b64u(*FILEHANDLE); |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head1 METHODS |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
The OO interface provides the same set of functions as L. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head2 new |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
$d = Crypt::Digest::RIPEMD320->new(); |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head2 clone |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
$d->clone(); |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head2 reset |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
$d->reset(); |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head2 add |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
$d->add('any data'); |
174
|
|
|
|
|
|
|
#or |
175
|
|
|
|
|
|
|
$d->add('any data', 'more data', 'even more data'); |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=head2 addfile |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
$d->addfile('filename.dat'); |
180
|
|
|
|
|
|
|
#or |
181
|
|
|
|
|
|
|
$d->addfile(*FILEHANDLE); |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head2 add_bits |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
$d->add_bits($bit_string); # e.g. $d->add_bits("111100001010"); |
186
|
|
|
|
|
|
|
#or |
187
|
|
|
|
|
|
|
$d->add_bits($data, $nbits); # e.g. $d->add_bits("\xF0\xA0", 16); |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head2 hashsize |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
$d->hashsize; |
192
|
|
|
|
|
|
|
#or |
193
|
|
|
|
|
|
|
Crypt::Digest::RIPEMD320->hashsize(); |
194
|
|
|
|
|
|
|
#or |
195
|
|
|
|
|
|
|
Crypt::Digest::RIPEMD320::hashsize(); |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=head2 digest |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
$result_raw = $d->digest(); |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=head2 hexdigest |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
$result_hex = $d->hexdigest(); |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=head2 b64digest |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
$result_b64 = $d->b64digest(); |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=head2 b64udigest |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
$result_b64url = $d->b64udigest(); |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
=head1 SEE ALSO |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=over |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
=item * L, L |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
=item * L |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
=back |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=cut |