| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Crypto::ECC; |
|
2
|
|
|
|
|
|
|
$Crypto::ECC::VERSION = '0.004'; |
|
3
|
1
|
|
|
1
|
|
70711
|
use Crypto::ECC::CurveFp; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
32
|
|
|
4
|
1
|
|
|
1
|
|
474
|
use Crypto::ECC::Point; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
29
|
|
|
5
|
1
|
|
|
1
|
|
474
|
use Crypto::ECC::PublicKey; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
32
|
|
|
6
|
1
|
|
|
1
|
|
450
|
use Crypto::ECC::Signature; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
32
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
6
|
use base 'Exporter'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
181
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw( |
|
11
|
|
|
|
|
|
|
$Point |
|
12
|
|
|
|
|
|
|
$CurveFp |
|
13
|
|
|
|
|
|
|
$PublicKey |
|
14
|
|
|
|
|
|
|
$Signature |
|
15
|
|
|
|
|
|
|
); |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $CurveFp = 'Crypto::ECC::CurveFp'; |
|
18
|
|
|
|
|
|
|
our $Point = 'Crypto::ECC::Point'; |
|
19
|
|
|
|
|
|
|
our $PublicKey = 'Crypto::ECC::PublicKey'; |
|
20
|
|
|
|
|
|
|
our $Signature = 'Crypto::ECC::Signature'; |
|
21
|
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Crypto::ECC - Perl Elliptic Curve DSA and DH |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
For more information on Elliptic Curve Cryptography please read http://matejdanter.com/2010/12/elliptic-curve-php-oop-dsa-and-diffie-hellman/ |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Requires GMP or bcmath extension, GMP preferred for better performance. |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head1 USAGE |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
use Crypto::ECC; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
and then the short version of the class names will be imported |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
$CurveFp --> 'Crypto::ECC::CurveFp'; |
|
41
|
|
|
|
|
|
|
$Point --> 'Crypto::ECC::Point'; |
|
42
|
|
|
|
|
|
|
$PublicKey --> 'Crypto::ECC::PublicKey'; |
|
43
|
|
|
|
|
|
|
$Signature --> 'Crypto::ECC::Signature'; |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
You don't have to use these classname aliases. It is just for my convenience. |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 CREDIT |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Direct Translation from PHP to Perl - https://github.com/phpecc/phpecc/tree/366c0d1d00cdf95b0511d34797c116d9be48410e |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 NOTE |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
These classes are not fully copied from the PHP version. Only copied enough to support DigiByte::DigiID |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Please email me if you wish to extends functions or become a contributor. |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 MIT Licence |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Licensed under the MIT License. |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |