| 1 | package Crypt::Sodium::XS::onetimeauth; | ||
| 2 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 1 | ▶ | use Crypt::Sodium::XS; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Exporter 'import'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | _define_constants(); | |
| 9 | |||
| 10 | { | ||
| 11 | 1 | my @constant_bases = qw( | |
| 12 | BYTES | ||
| 13 | KEYBYTES | ||
| 14 | ); | ||
| 15 | |||
| 16 | 1 | my @bases = qw( | |
| 17 | init | ||
| 18 | keygen | ||
| 19 | verify | ||
| 20 | ); | ||
| 21 | |||
| 22 | my $default = [ | ||
| 23 | "onetimeauth", | ||
| 24 | 3 | (map { "onetimeauth_$_" } @bases), | |
| 25 | 1 | (map { "onetimeauth_$_" } @constant_bases, "PRIMITIVE"), | |
| 26 | ]; | ||
| 27 | my $poly1305 = [ | ||
| 28 | "onetimeauth_poly1305", | ||
| 29 | 3 | (map { "onetimeauth_poly1305_$_" } @bases), | |
| 30 | 1 | (map { "onetimeauth_poly1305_$_" } @constant_bases), | |
| 31 | ]; | ||
| 32 | |||
| 33 | 1 | our %EXPORT_TAGS = ( | |
| 34 | all => [ @$default, @$poly1305 ], | ||
| 35 | default => $default, | ||
| 36 | poly1305 => $poly1305, | ||
| 37 | ); | ||
| 38 | |||
| 39 | 1 | our @EXPORT_OK = @{$EXPORT_TAGS{all}}; | |
| 40 | } | ||
| 41 | |||
| 42 | package Crypt::Sodium::XS::OO::onetimeauth; | ||
| 43 | 1 | ▶ | use parent 'Crypt::Sodium::XS::OO::Base'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 44 | |||
| 45 | my %methods = ( | ||
| 46 | default => { | ||
| 47 | BYTES => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_BYTES, | ||
| 48 | KEYBYTES => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_KEYBYTES, | ||
| 49 | PRIMITIVE => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_PRIMITIVE, | ||
| 50 | init => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_init, | ||
| 51 | keygen => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_keygen, | ||
| 52 | onetimeauth => \&Crypt::Sodium::XS::onetimeauth::onetimeauth, | ||
| 53 | verify => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_verify, | ||
| 54 | }, | ||
| 55 | poly1305 => { | ||
| 56 | BYTES => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_poly1305_BYTES, | ||
| 57 | KEYBYTES => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_poly1305_KEYBYTES, | ||
| 58 | 0 | ▶ | PRIMITIVE => sub { 'poly1305' }, |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 59 | 1 | init => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_poly1305_init, | |
| 60 | keygen => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_poly1305_keygen, | ||
| 61 | onetimeauth => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_poly1305, | ||
| 62 | verify => \&Crypt::Sodium::XS::onetimeauth::onetimeauth_poly1305_verify, | ||
| 63 | }, | ||
| 64 | ); | ||
| 65 | |||
| 66 | 3 | ▶ | sub Crypt::Sodium::XS::onetimeauth::primitives { keys %methods } |
|
Subroutine
primitives: called CC=1 SCAR=0.0
Pod
documented
| |||
| 67 | 1 | *primitives = \&Crypt::Sodium::XS::onetimeauth::primitives; | |
| 68 | |||
| 69 | 0 | ▶ | sub BYTES { my $self = shift; goto $methods{$self->{primitive}}->{BYTES}; } |
|
Subroutine
BYTES: not called CC=1 SCAR=6.9
| |||
| 70 | 0 | ▶ | sub KEYBYTES { my $self = shift; goto $methods{$self->{primitive}}->{KEYBYTES}; } |
|
Subroutine
KEYBYTES: not called CC=1 SCAR=6.9
| |||
| 71 | 0 | ▶ | sub PRIMITIVE { my $self = shift; goto $methods{$self->{primitive}}->{PRIMITIVE}; } |
|
Subroutine
PRIMITIVE: not called CC=1 SCAR=6.9
| |||
| 72 | 4 | ▶ | sub init { my $self = shift; goto $methods{$self->{primitive}}->{init}; } |
|
Subroutine
init: called CC=1 SCAR=0.0
| |||
| 73 | 2 | ▶ | sub keygen { my $self = shift; goto $methods{$self->{primitive}}->{keygen}; } |
|
Subroutine
keygen: called CC=1 SCAR=0.0
| |||
| 74 | 2 | ▶ | sub onetimeauth { my $self = shift; goto $methods{$self->{primitive}}->{onetimeauth}; } |
|
Subroutine
onetimeauth: called CC=1 SCAR=0.0
| |||
| 75 | 6 | ▶ | sub verify { my $self = shift; goto $methods{$self->{primitive}}->{verify}; } |
|
Subroutine
verify: called CC=1 SCAR=0.0
| |||
| 76 | |||
| 77 | 1 | 1; | |
| 78 | |||
| 79 | __END__ | ||