Crypt-Sodium-Nitrate

 view release on metacpan or  search on metacpan

Nitrate.xs  view on Meta::CPAN

}

MODULE = Crypt::Sodium::Nitrate        PACKAGE = Crypt::Sodium::Nitrate

PROTOTYPES: DISABLE

void
encrypt(SV* msg, SV* nonce, SV* key)
INIT:
    SV* encrypted_sv;
PPCODE:
{
    encrypted_sv = sodium_encrypt(msg, nonce, key);
    mXPUSHs( encrypted_sv );
    XSRETURN(1);
}

void
decrypt(SV* ciphertext, SV* nonce, SV* key)
INIT:
    SV* decrypted_sv;
PPCODE:
{
    decrypted_sv = sodium_decrypt(ciphertext, nonce, key);
    mXPUSHs( decrypted_sv );
    XSRETURN(1);
}

BOOT:
{
    /* let's create a couple of constants for perl to use */
    HV *stash = gv_stashpvs("Crypt::Sodium::Nitrate", GV_ADD);



( run in 1.913 second using v1.01-cache-2.11-cpan-71847e10f99 )