]> Dogcows Code - chaz/p5-File-KDBX-XS/commitdiff
move functions to the File::KDBX::XS module
authorCharles McGarvey <ccm@cpan.org>
Wed, 20 Apr 2022 01:36:45 +0000 (19:36 -0600)
committerCharles McGarvey <ccm@cpan.org>
Wed, 20 Apr 2022 01:36:45 +0000 (19:36 -0600)
XS.xs
lib/File/KDBX/XS.pm
t/kdf-aes.t

diff --git a/XS.xs b/XS.xs
index e6b7b2266137600cb60dc522486e3b9dfd0d5833..48f3077be972f7cb20ae84028f74780d6e74c51b 100644 (file)
--- a/XS.xs
+++ b/XS.xs
@@ -6,7 +6,7 @@
 
 #include "tomcrypt.h"
 
-MODULE = File::KDBX::XS  PACKAGE = File::KDBX::Util
+MODULE = File::KDBX::XS  PACKAGE = File::KDBX::XS
 
 PROTOTYPES: DISABLE
 
@@ -20,12 +20,8 @@ CowREFCNT(SV* sv)
     OUTPUT:
         RETVAL
 
-MODULE = File::KDBX::XS  PACKAGE = File::KDBX::KDF::AES
-
-PROTOTYPES: DISABLE
-
 SV*
-_transform_half_xs(const char* key, const char* seed, unsigned int rounds)
+kdf_aes_transform_half(const char* key, const char* seed, unsigned int rounds)
     CODE:
         symmetric_key skey;
 
index 57facc917c127cac5ce3d3586e67c6c8b5ab2314..6c8d4bdb1f3d1272456055fe96e24157f7c1b0b0 100644 (file)
@@ -4,10 +4,16 @@ package File::KDBX::XS;
 use warnings;
 use strict;
 
+use Exporter qw(import);
 use XSLoader;
 
 our $VERSION = '999.999'; # VERSION
 
+our @EXPORT_OK = qw(
+    CowREFCNT
+    kdf_aes_transform_half
+);
+
 XSLoader::load(__PACKAGE__, $VERSION);
 
 1;
@@ -38,4 +44,11 @@ bundled according to their own licensing terms (which are also permissive).
 
 =end HTML
 
+=func CowREFCNT
+
+Get the copy-on-write (COW) reference count of a scalar, or C<undef> if the perl does not support scalar COW
+or if the scalar is not COW.
+
+See also L<B::COW/"cowrefcnt( PV )">.
+
 =cut
index 94ddf820cac6f7fcfd6c8098e8060306989dd72c..32568999da2db32be2647a4990a5db0129a947ee 100644 (file)
@@ -11,7 +11,7 @@ my $seed        = "\1" x 16;
 my $rounds      = 123;
 my $expected    = pack('H*', '7deb990760f2ff0f9b8248d63bfb7264');
 
-my $result = File::KDBX::KDF::AES::_transform_half_xs($key, $seed, $rounds);
+my $result = File::KDBX::XS::kdf_aes_transform_half($key, $seed, $rounds);
 is $result, $expected, 'AES KDF transform works' or diag unpack('H*', $result);
 
 done_testing;
This page took 0.027732 seconds and 4 git commands to generate.