line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Keyczar::DsaPublicKey; |
2
|
3
|
|
|
3
|
|
4434
|
use base 'Crypt::Keyczar::Key'; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
350
|
|
3
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
90
|
|
4
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
87
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
15
|
use Crypt::Keyczar qw(KEY_HASH_SIZE); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
170
|
|
7
|
3
|
|
|
3
|
|
16
|
use Crypt::Keyczar::Util; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
2067
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub expose { |
12
|
5
|
|
|
5
|
0
|
11
|
my $self = shift; |
13
|
5
|
|
|
|
|
11
|
my $expose = {}; |
14
|
5
|
|
|
|
|
23
|
$expose->{y} = $self->{y}; |
15
|
5
|
|
|
|
|
13
|
$expose->{p} = $self->{p}; |
16
|
5
|
|
|
|
|
14
|
$expose->{q} = $self->{q}; |
17
|
5
|
|
|
|
|
11
|
$expose->{g} = $self->{g}; |
18
|
5
|
|
|
|
|
13
|
$expose->{size} = $self->{size}; |
19
|
5
|
|
|
|
|
17
|
return $expose; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub read { |
24
|
2
|
|
|
2
|
0
|
1454
|
my $class = shift; |
25
|
2
|
|
|
|
|
5
|
my $json_string = shift; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
11
|
my $obj = Crypt::Keyczar::Util::decode_json($json_string); |
28
|
2
|
|
|
|
|
6
|
my $self = bless $obj, $class; |
29
|
2
|
|
|
|
|
9
|
$self->init(); |
30
|
2
|
|
|
|
|
8
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub init { |
35
|
31
|
|
|
31
|
0
|
51
|
my $self = shift; |
36
|
31
|
|
|
|
|
128
|
my $y = Crypt::Keyczar::Util::decode($self->{y}); |
37
|
31
|
|
|
|
|
109
|
my $p = Crypt::Keyczar::Util::decode($self->{p}); |
38
|
31
|
|
|
|
|
95
|
my $q = Crypt::Keyczar::Util::decode($self->{q}); |
39
|
31
|
|
|
|
|
96
|
my $g = Crypt::Keyczar::Util::decode($self->{g}); |
40
|
31
|
|
|
|
|
86
|
$y =~ s/^\x00+//; |
41
|
31
|
|
|
|
|
66
|
$p =~ s/^\x00+//; |
42
|
31
|
|
|
|
|
49
|
$q =~ s/^\x00+//; |
43
|
31
|
|
|
|
|
46
|
$g =~ s/^\x00+//; |
44
|
31
|
|
|
|
|
689
|
my $hash = Crypt::Keyczar::Util::hash( |
45
|
|
|
|
|
|
|
pack('N1', length $p), $p, |
46
|
|
|
|
|
|
|
pack('N1', length $q), $q, |
47
|
|
|
|
|
|
|
pack('N1', length $g), $g, |
48
|
|
|
|
|
|
|
pack('N1', length $y), $y); |
49
|
31
|
|
|
|
|
266
|
$self->hash(substr $hash, 0, KEY_HASH_SIZE()); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub set { |
54
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
55
|
0
|
|
|
|
|
0
|
my ($y, $p, $q, $g) = @_; |
56
|
0
|
|
|
|
|
0
|
$self->{y} = $y; |
57
|
0
|
|
|
|
|
0
|
$self->{p} = $p; |
58
|
0
|
|
|
|
|
0
|
$self->{q} = $q; |
59
|
0
|
|
|
|
|
0
|
$self->{g} = $g; |
60
|
0
|
|
|
|
|
0
|
$self->init(); |
61
|
0
|
|
|
|
|
0
|
return $self; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
0
|
0
|
0
|
sub digest_size { return 48; } |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
sub get_engine { |
69
|
2
|
|
|
2
|
0
|
1081
|
my $self = shift; |
70
|
2
|
|
|
|
|
9
|
my @args = map { Crypt::Keyczar::Util::decode($_) } ($self->{y}, $self->{p}, $self->{q}, $self->{g}); |
|
8
|
|
|
|
|
22
|
|
71
|
2
|
|
|
|
|
81
|
return Crypt::Keyczar::DsaPublicKeyEngine->new(@args); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
package Crypt::Keyczar::DsaPublicKeyEngine; |
78
|
3
|
|
|
3
|
|
18
|
use base 'Exporter'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
243
|
|
79
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
82
|
|
80
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
112
|
|
81
|
3
|
|
|
3
|
|
18
|
use Crypt::Keyczar::Engine; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
104
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
__END__ |