Better POD
[authen-passphrase-scrypt.git] / Scrypt.xs
... / ...
CommitLineData
1#define PERL_NO_GET_CONTEXT
2#include "EXTERN.h"
3#include "perl.h"
4#include "XSUB.h"
5
6#include "ppport.h"
7
8#include <scrypt-1.2.1/lib/crypto/crypto_scrypt.h>
9
10MODULE = Authen::Passphrase::Scrypt PACKAGE = Authen::Passphrase::Scrypt
11
12PROTOTYPES: DISABLE
13
14SV*
15crypto_scrypt(const uint8_t *passwd, size_t length(passwd), \
16 const uint8_t *salt, size_t length(salt), \
17 uint64_t N, uint32_t r, uint32_t p, size_t buflen)
18CODE:
19 uint8_t *buf;
20 int err;
21 Newx(buf, buflen, uint8_t);
22 err = crypto_scrypt(passwd, XSauto_length_of_passwd, salt, XSauto_length_of_salt, N, r, p, buf, buflen);
23 if(err < 0)
24 croak("Error in crypto_scrypt");
25 RETVAL = newSVpvn((const char* const)buf, buflen);
26 Safefree(buf);
27OUTPUT:
28 RETVAL
This page took 0.007995 seconds and 4 git commands to generate.