line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Libmcrypt; |
2
|
|
|
|
|
|
|
#ABSTRACT: Perl extension for libmcrypt,the mcrypt cryptographic library |
3
|
1
|
|
|
1
|
|
13781
|
use 5.006000; |
|
1
|
|
|
|
|
2
|
|
4
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
15
|
|
5
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
6
|
1
|
|
|
1
|
|
2
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
67
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
1
|
|
|
1
|
|
456
|
use AutoLoader; |
|
1
|
|
|
|
|
1002
|
|
|
1
|
|
|
|
|
3
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = qw(Exporter); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
14
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
15
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# This allows declaration use Crypt::Libmcrypt ':all'; |
18
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
19
|
|
|
|
|
|
|
# will save memory. |
20
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( 'all' => [ qw( |
21
|
|
|
|
|
|
|
MCRYPT_API_VERSION |
22
|
|
|
|
|
|
|
MCRYPT_FAILED |
23
|
|
|
|
|
|
|
mcrypt_check_version |
24
|
|
|
|
|
|
|
mcrypt_enc_get_state |
25
|
|
|
|
|
|
|
mcrypt_enc_get_supported_key_sizes |
26
|
|
|
|
|
|
|
mcrypt_enc_mode_has_iv |
27
|
|
|
|
|
|
|
mcrypt_enc_set_state |
28
|
|
|
|
|
|
|
mcrypt_free |
29
|
|
|
|
|
|
|
mcrypt_free_p |
30
|
|
|
|
|
|
|
mcrypt_generic |
31
|
|
|
|
|
|
|
mcrypt_generic_deinit |
32
|
|
|
|
|
|
|
mcrypt_generic_end |
33
|
|
|
|
|
|
|
mcrypt_generic_init |
34
|
|
|
|
|
|
|
mcrypt_module_algorithm_version |
35
|
|
|
|
|
|
|
mcrypt_module_close |
36
|
|
|
|
|
|
|
mcrypt_module_get_algo_block_size |
37
|
|
|
|
|
|
|
mcrypt_module_get_algo_key_size |
38
|
|
|
|
|
|
|
mcrypt_module_get_algo_supported_key_sizes |
39
|
|
|
|
|
|
|
mcrypt_module_is_block_algorithm |
40
|
|
|
|
|
|
|
mcrypt_module_is_block_algorithm_mode |
41
|
|
|
|
|
|
|
mcrypt_module_is_block_mode |
42
|
|
|
|
|
|
|
mcrypt_module_mode_version |
43
|
|
|
|
|
|
|
mcrypt_module_open |
44
|
|
|
|
|
|
|
mcrypt_module_self_test |
45
|
|
|
|
|
|
|
mcrypt_module_support_dynamic |
46
|
|
|
|
|
|
|
mcrypt_perror |
47
|
|
|
|
|
|
|
mcrypt_strerror |
48
|
|
|
|
|
|
|
mdecrypt_generic |
49
|
|
|
|
|
|
|
) ] ); |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
our @EXPORT = qw( |
54
|
|
|
|
|
|
|
MCRYPT_API_VERSION |
55
|
|
|
|
|
|
|
MCRYPT_FAILED |
56
|
|
|
|
|
|
|
); |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
our $VERSION = '1.0.3'; |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub AUTOLOAD { |
61
|
|
|
|
|
|
|
# This AUTOLOAD is used to 'autoload' constants from the constant() |
62
|
|
|
|
|
|
|
# XS function. |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
0
|
|
|
my $constname; |
65
|
0
|
|
|
|
|
|
our $AUTOLOAD; |
66
|
0
|
|
|
|
|
|
($constname = $AUTOLOAD) =~ s/.*:://; |
67
|
0
|
0
|
|
|
|
|
croak "&Crypt::Libmcrypt::constant not defined" if $constname eq 'constant'; |
68
|
0
|
|
|
|
|
|
my ($error, $val) = constant($constname); |
69
|
0
|
0
|
|
|
|
|
if ($error) { croak $error; } |
|
0
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
{ |
71
|
1
|
|
|
1
|
|
539
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
80
|
|
|
0
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# Fixed between 5.005_53 and 5.005_61 |
73
|
|
|
|
|
|
|
#XXX if ($] >= 5.00561) { |
74
|
|
|
|
|
|
|
#XXX *$AUTOLOAD = sub () { $val }; |
75
|
|
|
|
|
|
|
#XXX } |
76
|
|
|
|
|
|
|
#XXX else { |
77
|
0
|
|
|
0
|
|
|
*$AUTOLOAD = sub { $val }; |
|
0
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
#XXX } |
79
|
|
|
|
|
|
|
} |
80
|
0
|
|
|
|
|
|
goto &$AUTOLOAD; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
require XSLoader; |
84
|
|
|
|
|
|
|
XSLoader::load('Crypt::Libmcrypt', $VERSION); |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# Preloaded methods go here. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
__END__ |