line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::OpenSSL::ECDSA; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
81603
|
use 5.008005; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
18
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
49
|
|
6
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
83
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
require Exporter; |
9
|
1
|
|
|
1
|
|
743
|
use AutoLoader; |
|
1
|
|
|
|
|
1606
|
|
|
1
|
|
|
|
|
7
|
|
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::OpenSSL::ECDSA ':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
|
|
|
|
|
|
|
ECDSA_F_ECDSA_CHECK |
22
|
|
|
|
|
|
|
ECDSA_F_ECDSA_DATA_NEW_METHOD |
23
|
|
|
|
|
|
|
ECDSA_F_ECDSA_DO_SIGN |
24
|
|
|
|
|
|
|
ECDSA_F_ECDSA_DO_VERIFY |
25
|
|
|
|
|
|
|
ECDSA_F_ECDSA_SIGN_SETUP |
26
|
|
|
|
|
|
|
ECDSA_R_BAD_SIGNATURE |
27
|
|
|
|
|
|
|
ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE |
28
|
|
|
|
|
|
|
ECDSA_R_ERR_EC_LIB |
29
|
|
|
|
|
|
|
ECDSA_R_MISSING_PARAMETERS |
30
|
|
|
|
|
|
|
ECDSA_R_NEED_NEW_SETUP_VALUES |
31
|
|
|
|
|
|
|
ECDSA_R_NON_FIPS_METHOD |
32
|
|
|
|
|
|
|
ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED |
33
|
|
|
|
|
|
|
ECDSA_R_SIGNATURE_MALLOC_FAILED |
34
|
|
|
|
|
|
|
) ] ); |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
our @EXPORT = qw( |
39
|
|
|
|
|
|
|
ECDSA_F_ECDSA_CHECK |
40
|
|
|
|
|
|
|
ECDSA_F_ECDSA_DATA_NEW_METHOD |
41
|
|
|
|
|
|
|
ECDSA_F_ECDSA_DO_SIGN |
42
|
|
|
|
|
|
|
ECDSA_F_ECDSA_DO_VERIFY |
43
|
|
|
|
|
|
|
ECDSA_F_ECDSA_SIGN_SETUP |
44
|
|
|
|
|
|
|
ECDSA_R_BAD_SIGNATURE |
45
|
|
|
|
|
|
|
ECDSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE |
46
|
|
|
|
|
|
|
ECDSA_R_ERR_EC_LIB |
47
|
|
|
|
|
|
|
ECDSA_R_MISSING_PARAMETERS |
48
|
|
|
|
|
|
|
ECDSA_R_NEED_NEW_SETUP_VALUES |
49
|
|
|
|
|
|
|
ECDSA_R_NON_FIPS_METHOD |
50
|
|
|
|
|
|
|
ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED |
51
|
|
|
|
|
|
|
ECDSA_R_SIGNATURE_MALLOC_FAILED |
52
|
|
|
|
|
|
|
); |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
our $VERSION = '0.09'; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub AUTOLOAD { |
57
|
|
|
|
|
|
|
# This AUTOLOAD is used to 'autoload' constants from the constant() |
58
|
|
|
|
|
|
|
# XS function. |
59
|
|
|
|
|
|
|
|
60
|
13
|
|
|
13
|
|
999
|
my $constname; |
61
|
13
|
|
|
|
|
17
|
our $AUTOLOAD; |
62
|
13
|
|
|
|
|
60
|
($constname = $AUTOLOAD) =~ s/.*:://; |
63
|
13
|
50
|
|
|
|
38
|
croak "&Crypt::OpenSSL::ECDSA::constant not defined" if $constname eq 'constant'; |
64
|
13
|
|
|
|
|
68
|
my ($error, $val) = constant($constname); |
65
|
13
|
50
|
|
|
|
30
|
if ($error) { croak $error; } |
|
0
|
|
|
|
|
0
|
|
66
|
|
|
|
|
|
|
{ |
67
|
1
|
|
|
1
|
|
243
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
145
|
|
|
13
|
|
|
|
|
17
|
|
68
|
|
|
|
|
|
|
# Fixed between 5.005_53 and 5.005_61 |
69
|
|
|
|
|
|
|
#XXX if ($] >= 5.00561) { |
70
|
|
|
|
|
|
|
#XXX *$AUTOLOAD = sub () { $val }; |
71
|
|
|
|
|
|
|
#XXX } |
72
|
|
|
|
|
|
|
#XXX else { |
73
|
13
|
|
|
13
|
|
76
|
*$AUTOLOAD = sub { $val }; |
|
13
|
|
|
|
|
165
|
|
74
|
|
|
|
|
|
|
#XXX } |
75
|
|
|
|
|
|
|
} |
76
|
13
|
|
|
|
|
56
|
goto &$AUTOLOAD; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
eval { |
81
|
|
|
|
|
|
|
local $SIG{'__DIE__'} = 'DEFAULT'; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
eval { |
84
|
|
|
|
|
|
|
require XSLoader; |
85
|
|
|
|
|
|
|
XSLoader::load( 'Crypt::OpenSSL::ECDSA', $VERSION ); |
86
|
|
|
|
|
|
|
1; |
87
|
|
|
|
|
|
|
} or do { |
88
|
1
|
|
|
1
|
|
11
|
use vars qw(@ISA); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
137
|
|
89
|
|
|
|
|
|
|
require DynaLoader; |
90
|
|
|
|
|
|
|
push @ISA, 'DynaLoader'; |
91
|
|
|
|
|
|
|
bootstrap('Crypt::OpenSSL::ECDSA', $VERSION); |
92
|
|
|
|
|
|
|
}; |
93
|
|
|
|
|
|
|
}; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
# Preloaded methods go here. |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# Autoload methods go after =cut, and are processed by the autosplit program. |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |
101
|
|
|
|
|
|
|
__END__ |