blib/lib/Crypt/Cipher/ARIA.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 6 / 6 totaltotal 100% 34 / 34 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Crypt/Cipher/AES.pm ↑ Summary blib/lib/Crypt/Cipher/Anubis.pm »
1 package Crypt::Cipher::ARIA;
2  
3 ### BEWARE - GENERATED FILE, DO NOT EDIT MANUALLY!
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 our $VERSION = '0.091';
8  
9 2 ▶use base qw(Crypt::Cipher);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 10 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
12 10 my ($class, @args) = @_;
13 10 my $obj = Crypt::Cipher->new('ARIA', @args);
14 10 return bless $obj, $class;
15 }
16  
17 3 ▶sub blocksize { Crypt::Cipher::blocksize('ARIA') }
Subroutine blocksize: called CC=1 SCAR=0.0
Pod documented
18 3 ▶sub keysize { Crypt::Cipher::keysize('ARIA') }
Subroutine keysize: called CC=1 SCAR=0.0
Pod documented
19 3 ▶sub max_keysize { Crypt::Cipher::max_keysize('ARIA') }
Subroutine max_keysize: called CC=1 SCAR=0.0
Pod documented
20 3 ▶sub min_keysize { Crypt::Cipher::min_keysize('ARIA') }
Subroutine min_keysize: called CC=1 SCAR=0.0
Pod documented
21 3 ▶sub default_rounds { Crypt::Cipher::default_rounds('ARIA') }
Subroutine default_rounds: called CC=1 SCAR=0.0
Pod documented
22  
23 2 1;
24  
25 =pod
26  
27 =head1 NAME
28  
29 Crypt::Cipher::ARIA - Symmetric cipher ARIA, key size: 128/192/256 bits
30  
31 =head1 SYNOPSIS
32  
33 ### example 1
34 use Crypt::Mode::CBC;
35  
36 my $key = '...'; # length must be a valid key size for this cipher
37 my $iv = '...'; # 16 bytes
38 my $cbc = Crypt::Mode::CBC->new('ARIA');
39 my $ciphertext = $cbc->encrypt("secret data", $key, $iv);
40  
41 ### example 2 (slower)
42 use Crypt::CBC;
43 use Crypt::Cipher::ARIA;
44  
45 my $key = '...'; # length must be a valid key size for this cipher
46 my $iv = '...'; # 16 bytes
47 my $cbc = Crypt::CBC->new( -cipher=>'Cipher::ARIA', -key=>$key, -iv=>$iv );
48 my $ciphertext = $cbc->encrypt("secret data");
49  
50 =head1 DESCRIPTION
51  
52 I<Since: CryptX-0.090>
53  
54 This module implements the ARIA cipher. Its interface is compatible with L<Crypt::CBC>.
55  
56 B<Note:> This module only implements single-block encryption and decryption.
57 For general data, use a block mode such as
58 L<Crypt::Mode::CBC>, L<Crypt::Mode::CTR>, or L<Crypt::CBC> (which is slower).
59  
60 =head1 METHODS
61  
62 Unless noted otherwise, assume C<$c> is an existing cipher object created via
63 C<new>, for example:
64  
65 my $c = Crypt::Cipher::ARIA->new($key);
66  
67 =head2 new
68  
69 my $c = Crypt::Cipher::ARIA->new($key);
70 #or
71 my $c = Crypt::Cipher::ARIA->new($key, $rounds);
72  
73 # $key .... [binary string] key of an accepted length (see keysize, min_keysize, max_keysize)
74 # $rounds . [integer] optional, number of rounds (if supported by the cipher; croaks on invalid value)
75  
76 =head2 encrypt
77  
78 Encrypts exactly one block of plaintext. The length of C<$plaintext> must
79 equal L</blocksize>; croaks otherwise. An empty string is accepted and
80 returned unchanged.
81  
82 my $ciphertext = $c->encrypt($plaintext);
83  
84 Returns the encrypted block as a binary string (raw bytes).
85  
86 =head2 decrypt
87  
88 Decrypts exactly one block of ciphertext. The length of C<$ciphertext> must
89 equal L</blocksize>; croaks otherwise. An empty string is accepted and
90 returned unchanged.
91  
92 my $plaintext = $c->decrypt($ciphertext);
93  
94 Returns the decrypted block as a binary string (raw bytes).
95  
96 =head2 keysize
97  
98 Just an alias for C<max_keysize>.
99  
100 $c->keysize;
101 #or
102 Crypt::Cipher::ARIA->keysize;
103 #or
104 Crypt::Cipher::ARIA::keysize;
105  
106 =head2 blocksize
107  
108 Returns the cipher block size (in bytes).
109  
110 $c->blocksize;
111 #or
112 Crypt::Cipher::ARIA->blocksize;
113 #or
114 Crypt::Cipher::ARIA::blocksize;
115  
116 =head2 max_keysize
117  
118 Returns the maximum key size (in bytes).
119  
120 $c->max_keysize;
121 #or
122 Crypt::Cipher::ARIA->max_keysize;
123 #or
124 Crypt::Cipher::ARIA::max_keysize;
125  
126 =head2 min_keysize
127  
128 Returns the minimum key size (in bytes).
129  
130 $c->min_keysize;
131 #or
132 Crypt::Cipher::ARIA->min_keysize;
133 #or
134 Crypt::Cipher::ARIA::min_keysize;
135  
136 =head2 default_rounds
137  
138 Returns the cipher's default round count.
139  
140 $c->default_rounds;
141 #or
142 Crypt::Cipher::ARIA->default_rounds;
143 #or
144 Crypt::Cipher::ARIA::default_rounds;
145  
146 =head1 SEE ALSO
147  
148 =over
149  
150 =item * L<CryptX>, L<Crypt::Cipher>
151  
152 =item * L<https://en.wikipedia.org/wiki/ARIA_(cipher)>
153  
154 =item * L<https://www.rfc-editor.org/rfc/rfc5794>
155  
156 =back
157  
158 =cut
« blib/lib/Crypt/Cipher/AES.pm ↑ Summary blib/lib/Crypt/Cipher/Anubis.pm »