cardano-crypto-class-2.2.0.0: Type classes abstracting over cryptography primitives for Cardano
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cardano.Crypto.Libsodium.C

Synopsis

Initialization

Memory management

c_sodium_memzeroPtr a → CSizeIO () Source #

void sodium_memzero(void * const pnt, const size_t len);

https://libsodium.gitbook.io/doc/memory_management#zeroing-memory

c_sodium_mlockPtr a → CSizeIO CInt Source #

void *sodium_mlock(void * const addr, size_t size);

https://libsodium.gitbook.io/doc/memory_management

c_sodium_munlockPtr a → CSizeIO CInt Source #

void *sodium_munlock(void * const addr, size_t size);

https://libsodium.gitbook.io/doc/memory_management

Hashing

SHA256

c_crypto_hash_sha256SizedPtr CRYPTO_SHA256_BYTESPtr CUCharCULLongIO Int Source #

int crypto_hash_sha256(unsigned char *out, const unsigned char *in, unsigned long long inlen);

https://libsodium.gitbook.io/doc/advanced/sha-2_hash_function

c_crypto_hash_sha256_finalSizedPtr CRYPTO_SHA256_STATE_SIZESizedPtr CRYPTO_SHA256_BYTESIO Int Source #

int crypto_hash_sha256_final(crypto_hash_sha256_state *state, unsigned char *out);

c_crypto_hash_sha256_initSizedPtr CRYPTO_SHA256_STATE_SIZEIO Int Source #

int crypto_hash_sha256_init(crypto_hash_sha256_state *state);

c_crypto_hash_sha256_updateSizedPtr CRYPTO_SHA256_STATE_SIZEPtr CUCharCULLongIO Int Source #

int crypto_hash_sha256_update(crypto_hash_sha256_state *state, const unsigned char *in, unsigned long long inlen);

Blake2b 256

c_crypto_generichash_blake2bPtr out → CSizePtr CUCharCULLongPtr key → CSizeIO Int Source #

int crypto_generichash_blake2b(unsigned char *out, size_t outlen, const unsigned char *in, unsigned long long inlen, const unsigned char *key, size_t keylen);

https://libsodium.gitbook.io/doc/hashing/generic_hashing

c_crypto_generichash_blake2b_finalSizedPtr CRYPTO_BLAKE2B_256_STATE_SIZEPtr out → CSizeIO Int Source #

int crypto_generichash_blake2b_final(crypto_generichash_blake2b_state *state, unsigned char *out, const size_t outlen);

c_crypto_generichash_blake2b_initSizedPtr CRYPTO_BLAKE2B_256_STATE_SIZEPtr key → CSizeCSizeIO Int Source #

int crypto_generichash_blake2b_init(crypto_generichash_blake2b_state *state, const unsigned char *key, const size_t keylen, const size_t outlen);

c_crypto_generichash_blake2b_updateSizedPtr CRYPTO_BLAKE2B_256_STATE_SIZEPtr CUCharCULLongIO Int Source #

int crypto_generichash_blake2b_update(crypto_generichash_blake2b_state *state, const unsigned char *in, unsigned long long inlen);

ED25519

c_crypto_sign_ed25519_seed_keypairSizedPtr CRYPTO_SIGN_ED25519_PUBLICKEYBYTESSizedPtr CRYPTO_SIGN_ED25519_SECRETKEYBYTESSizedPtr CRYPTO_SIGN_ED25519_SEEDBYTESIO Int Source #

int crypto_sign_ed25519_seed_keypair(unsigned char *pk, unsigned char *sk, const unsigned char *seed);

c_crypto_sign_ed25519_sk_to_seedSizedPtr CRYPTO_SIGN_ED25519_SEEDBYTESSizedPtr CRYPTO_SIGN_ED25519_SECRETKEYBYTESIO Int Source #

int crypto_sign_ed25519_sk_to_seed(unsigned char *seed, const unsigned char *sk);

c_crypto_sign_ed25519_detachedSizedPtr CRYPTO_SIGN_ED25519_BYTESPtr CULLongPtr CUCharCULLongSizedPtr CRYPTO_SIGN_ED25519_SECRETKEYBYTESIO Int Source #

int crypto_sign_ed25519_detached(unsigned char *sig, unsigned long long *siglen_p, const unsigned char *m, unsigned long long mlen, const unsigned char *sk);

c_crypto_sign_ed25519_verify_detachedSizedPtr CRYPTO_SIGN_ED25519_BYTESPtr CUCharCULLongSizedPtr CRYPTO_SIGN_ED25519_PUBLICKEYBYTESIO Int Source #

int crypto_sign_ed25519_verify_detached(const unsigned char *sig, const unsigned char *m, unsigned long long mlen, const unsigned char *pk);

c_crypto_sign_ed25519_sk_to_pkSizedPtr CRYPTO_SIGN_ED25519_PUBLICKEYBYTESSizedPtr CRYPTO_SIGN_ED25519_SECRETKEYBYTESIO Int Source #

int crypto_sign_ed25519_sk_to_pk(unsigned char *pk, const unsigned char *sk);

RNG

c_sodium_randombytes_bufPtr a → CSizeIO () Source #

void randombytes_buf(void * const buf, const size_t size);

Helpers

c_sodium_comparePtr a → Ptr a → CSizeIO Int Source #

int sodium_compare(const void * const b1_, const void * const b2_, size_t len);

https://libsodium.gitbook.io/doc/helpers#comparing-large-numbers

Constants