Crypt-Nettle

 view release on metacpan or  search on metacpan

Nettle.xs  view on Meta::CPAN

    OUTPUT:
        RETVAL

void
cnh_update(cnh, data)
    Crypt_Nettle_Hash cnh;
    SV* data;
    PREINIT:
        const uint8_t* buf;
        unsigned len;
    PPCODE:
        buf = SvPV(data, len);
        cnh->hashtype->update(cnh->hash_context, len, buf);
        XSRETURN(1);

SV *
cnh_digest(cnh)
    Crypt_Nettle_Hash cnh;
    PREINIT:
        uint8_t* outbuf;
    CODE:

Nettle.xs  view on Meta::CPAN

        }
        if (NULL == algo) XSRETURN_UNDEF;
        RETVAL = algo->block_size;
    OUTPUT:
        RETVAL

void
cnh_algos_available()
    PREINIT:
        int i;
    PPCODE:
        for (i = 0; i < sizeof(hash_algos_available)/sizeof(*hash_algos_available); i++)
          XPUSHs(sv_2mortal(newSVpv(hash_algos_available[i]->name, 0)));

void
cnh_DESTROY(cnh)
    Crypt_Nettle_Hash cnh;
    CODE:
        Safefree(cnh->hash_context);
        Safefree(cnh);
        cnh = NULL;

Nettle.xs  view on Meta::CPAN

    OUTPUT:
        RETVAL

void
cnc_process_in_place(cnc, data)
    Crypt_Nettle_Cipher cnc;
    SV * data;
    PREINIT:
        uint8_t * databuf;
        int datalen;
    PPCODE:
        databuf = SvPV(data, datalen);
        _cnc_process(cnc, datalen, databuf, databuf);


int
cnc_key_size(...)
    PROTOTYPE: @
    PREINIT:
        Crypt_Nettle_Cipher cnc;
        const struct nettle_cipher* algo;

Nettle.xs  view on Meta::CPAN

        }
        if (NULL == algo) XSRETURN_UNDEF;
        RETVAL = algo->block_size;
    OUTPUT:
        RETVAL

void
cnc_algos_available()
    PREINIT:
        int i;
    PPCODE:
        for (i = 0; i < sizeof(cipher_algos_available)/sizeof(*cipher_algos_available); i++)
          XPUSHs(sv_2mortal(newSVpv(cipher_algos_available[i]->name, 0)));

void
cnc_modes_available()
    PREINIT:
        int i;
    PPCODE:
        for (i = 0; i < sizeof(cipher_modes_available)/sizeof(*cipher_modes_available); i++)
          XPUSHs(sv_2mortal(newSVpv(cipher_modes_available[i].name, 0)));

void
cnc_DESTROY(cnc)
    Crypt_Nettle_Cipher cnc;
    CODE:
        Safefree(cnc->cipher_context);
        Safefree(cnc);
        cnc = NULL;

Nettle.xs  view on Meta::CPAN

    OUTPUT:
        RETVAL

void
cny_seed(cny, seed)
    Crypt_Nettle_Yarrow cny;
    SV * seed;
    PREINIT:
        int seedlen;
        const uint8_t * seeddata;
    PPCODE:
        seeddata = SvPV(seed, seedlen);
        yarrow256_seed(&cny->yarrow_ctx, seedlen, seeddata);


SV*
cny_random(cny, len)
    Crypt_Nettle_Yarrow cny;
    int len;
    PREINIT:
        uint8_t * outbuf;

Nettle.xs  view on Meta::CPAN

  cny = NULL;
}


MODULE = Crypt::Nettle        PACKAGE = Crypt::Nettle::RSA    PREFIX = cnrsa_

void
cnrsa_hashes_available()
    PREINIT:
        int i;
    PPCODE:
        for (i = 0; i < sizeof(_cnrsa_hashes_available)/sizeof(*_cnrsa_hashes_available); i++)
          XPUSHs(sv_2mortal(newSVpv(_cnrsa_hashes_available[i].hash->name, 0)));


Crypt_Nettle_RSA
cnrsa_new_public_key(classname, n, e)
    const char * classname;
    SV * n;
    SV * e;
    CODE:



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