line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Keyczar::DsaPublicKey; |
2
|
3
|
|
|
3
|
|
2451
|
use base 'Crypt::Keyczar::Key'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
208
|
|
3
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
46
|
|
4
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
63
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
13
|
use Crypt::Keyczar qw(KEY_HASH_SIZE); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
123
|
|
7
|
3
|
|
|
3
|
|
25
|
use Crypt::Keyczar::Util; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
1200
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub expose { |
12
|
5
|
|
|
5
|
0
|
13
|
my $self = shift; |
13
|
5
|
|
|
|
|
10
|
my $expose = {}; |
14
|
5
|
|
|
|
|
15
|
$expose->{y} = $self->{y}; |
15
|
5
|
|
|
|
|
12
|
$expose->{p} = $self->{p}; |
16
|
5
|
|
|
|
|
12
|
$expose->{q} = $self->{q}; |
17
|
5
|
|
|
|
|
11
|
$expose->{g} = $self->{g}; |
18
|
5
|
|
|
|
|
10
|
$expose->{size} = $self->{size}; |
19
|
5
|
|
|
|
|
15
|
return $expose; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub read { |
24
|
2
|
|
|
2
|
0
|
967
|
my $class = shift; |
25
|
2
|
|
|
|
|
6
|
my $json_string = shift; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
10
|
my $obj = Crypt::Keyczar::Util::decode_json($json_string); |
28
|
2
|
|
|
|
|
6
|
my $self = bless $obj, $class; |
29
|
2
|
|
|
|
|
7
|
$self->init(); |
30
|
2
|
|
|
|
|
6
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub init { |
35
|
31
|
|
|
31
|
0
|
52
|
my $self = shift; |
36
|
31
|
|
|
|
|
93
|
my $y = Crypt::Keyczar::Util::decode($self->{y}); |
37
|
31
|
|
|
|
|
79
|
my $p = Crypt::Keyczar::Util::decode($self->{p}); |
38
|
31
|
|
|
|
|
131
|
my $q = Crypt::Keyczar::Util::decode($self->{q}); |
39
|
31
|
|
|
|
|
77
|
my $g = Crypt::Keyczar::Util::decode($self->{g}); |
40
|
31
|
|
|
|
|
75
|
$y =~ s/^\x00+//; |
41
|
31
|
|
|
|
|
54
|
$p =~ s/^\x00+//; |
42
|
31
|
|
|
|
|
63
|
$q =~ s/^\x00+//; |
43
|
31
|
|
|
|
|
57
|
$g =~ s/^\x00+//; |
44
|
31
|
|
|
|
|
394
|
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
|
|
|
|
|
187
|
$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
|
699
|
my $self = shift; |
70
|
2
|
|
|
|
|
7
|
my @args = map { Crypt::Keyczar::Util::decode($_) } ($self->{y}, $self->{p}, $self->{q}, $self->{g}); |
|
8
|
|
|
|
|
22
|
|
71
|
2
|
|
|
|
|
49
|
return Crypt::Keyczar::DsaPublicKeyEngine->new(@args); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
package Crypt::Keyczar::DsaPublicKeyEngine; |
78
|
3
|
|
|
3
|
|
20
|
use base 'Exporter'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
161
|
|
79
|
3
|
|
|
3
|
|
15
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
46
|
|
80
|
3
|
|
|
3
|
|
11
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
62
|
|
81
|
3
|
|
|
3
|
|
12
|
use Crypt::Keyczar::Engine; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
67
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |
85
|
|
|
|
|
|
|
__END__ |