]> Dogcows Code - chaz/p5-File-KDBX/blobdiff - lib/File/KDBX/Cipher/CBC.pm
Add function for creating class attributes
[chaz/p5-File-KDBX] / lib / File / KDBX / Cipher / CBC.pm
index 8336af4b4a31e79688833d3b6bc14f0d1da59ba2..467b935f65104d1a1c9146deb8e322c82a89e8ac 100644 (file)
@@ -6,12 +6,17 @@ use strict;
 
 use Crypt::Mode::CBC;
 use File::KDBX::Error;
+use File::KDBX::Util qw(:class);
 use namespace::clean;
 
-use parent 'File::KDBX::Cipher';
+extends 'File::KDBX::Cipher';
 
 our $VERSION = '999.999'; # VERSION
 
+has key_size => 32;
+sub iv_size     { 16 }
+sub block_size  { 16 }
+
 sub encrypt {
     my $self = shift;
 
@@ -44,17 +49,6 @@ sub finish {
     return $out;
 }
 
-=attr algorithm
-
-Get the symmetric cipher algorithm.
-
-=cut
-
-sub algorithm   { $_[0]->{algorithm} or throw 'Block cipher algorithm is not set' }
-sub key_size    { $_[0]->{key_size} // 32 }
-sub iv_size     { 16 }
-sub block_size  { 16 }
-
 1;
 __END__
 
This page took 0.020586 seconds and 4 git commands to generate.