line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::RIPEMD160; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
16431
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
4
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
118
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
require DynaLoader; |
8
|
|
|
|
|
|
|
require AutoLoader; |
9
|
|
|
|
|
|
|
@ISA = qw(Exporter AutoLoader DynaLoader); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Items to export into callers namespace by default |
12
|
|
|
|
|
|
|
@EXPORT = qw(); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
@EXPORT_OK = qw(); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$VERSION = '0.06'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
bootstrap Crypt::RIPEMD160 $VERSION; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#package RIPEMD160; # Package-Definition like in Crypt::IDEA |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#use strict; |
23
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
88
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub addfile |
26
|
|
|
|
|
|
|
{ |
27
|
1
|
|
|
1
|
|
4
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
272
|
|
28
|
3
|
|
|
3
|
0
|
968309
|
my ($self, $handle) = @_; |
29
|
3
|
|
|
|
|
8
|
my ($package, $file, $line) = caller; |
30
|
3
|
|
|
|
|
4
|
my ($data); |
31
|
|
|
|
|
|
|
|
32
|
3
|
100
|
|
|
|
9
|
if (!ref($handle)) { |
33
|
2
|
50
|
|
|
|
16
|
$handle = $package . "::" . $handle unless ($handle =~ /(\:\:|\')/); |
34
|
|
|
|
|
|
|
} |
35
|
3
|
|
|
|
|
62
|
while (read($handle, $data, 8192)) { |
36
|
3
|
|
|
|
|
463
|
$self->add($data); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub hexdigest |
41
|
|
|
|
|
|
|
{ |
42
|
16
|
|
|
16
|
0
|
8871
|
my ($self) = shift; |
43
|
16
|
|
|
|
|
16
|
my ($tmp); |
44
|
|
|
|
|
|
|
|
45
|
16
|
|
|
|
|
115
|
$tmp = unpack("H*", ($self->digest())); |
46
|
16
|
|
|
|
|
111
|
return(substr($tmp, 0,8) . " " . substr($tmp, 8,8) . " " . |
47
|
|
|
|
|
|
|
substr($tmp,16,8) . " " . substr($tmp,24,8) . " " . |
48
|
|
|
|
|
|
|
substr($tmp,32,8)); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub hash |
52
|
|
|
|
|
|
|
{ |
53
|
3
|
|
|
3
|
0
|
5
|
my($self, $data) = @_; |
54
|
|
|
|
|
|
|
|
55
|
3
|
50
|
|
|
|
7
|
if (ref($self)) { |
56
|
0
|
|
|
|
|
0
|
$self->reset(); |
57
|
|
|
|
|
|
|
} else { |
58
|
3
|
|
|
|
|
10
|
$self = new Crypt::RIPEMD160; |
59
|
|
|
|
|
|
|
} |
60
|
3
|
|
|
|
|
15
|
$self->add($data); |
61
|
3
|
|
|
|
|
93
|
$self->digest(); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub hexhash |
65
|
|
|
|
|
|
|
{ |
66
|
10
|
|
|
10
|
0
|
1031
|
my($self, $data) = @_; |
67
|
|
|
|
|
|
|
|
68
|
10
|
100
|
|
|
|
24
|
if (ref($self)) { |
69
|
1
|
|
|
|
|
6
|
$self->reset(); |
70
|
|
|
|
|
|
|
} else { |
71
|
9
|
|
|
|
|
33
|
$self = new Crypt::RIPEMD160; |
72
|
|
|
|
|
|
|
} |
73
|
10
|
|
|
|
|
353
|
$self->add($data); |
74
|
10
|
|
|
|
|
972
|
$self->hexdigest(); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
__END__ |