cardano-crypto-class-2.0.0.0.1: Type classes abstracting over cryptography primitives for Cardano
Safe Haskell Safe-Inferred
Language Haskell2010

Cardano.Crypto.Libsodium.C

Synopsis

Initialization

Memory management

Hashing

SHA256

c_crypto_hash_sha256_final :: SizedPtr CRYPTO_SHA256_STATE_SIZE -> SizedPtr CRYPTO_SHA256_BYTES -> IO Int Source #

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

c_crypto_hash_sha256_init :: SizedPtr CRYPTO_SHA256_STATE_SIZE -> IO Int Source #

int crypto_hash_sha256_init(crypto_hash_sha256_state *state);

c_crypto_hash_sha256_update :: SizedPtr CRYPTO_SHA256_STATE_SIZE -> Ptr CUChar -> CULLong -> IO 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_blake2b :: Ptr out -> CSize -> Ptr CUChar -> CULLong -> Ptr key -> CSize -> IO 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_final :: SizedPtr CRYPTO_BLAKE2B_256_STATE_SIZE -> Ptr out -> CSize -> IO Int Source #

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

c_crypto_generichash_blake2b_init :: SizedPtr CRYPTO_BLAKE2B_256_STATE_SIZE -> Ptr key -> CSize -> CSize -> IO 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_update :: SizedPtr CRYPTO_BLAKE2B_256_STATE_SIZE -> Ptr CUChar -> CULLong -> IO 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_detached :: SizedPtr CRYPTO_SIGN_ED25519_BYTES -> Ptr CULLong -> Ptr CUChar -> CULLong -> SizedPtr CRYPTO_SIGN_ED25519_SECRETKEYBYTES -> IO 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_detached :: SizedPtr CRYPTO_SIGN_ED25519_BYTES -> Ptr CUChar -> CULLong -> SizedPtr CRYPTO_SIGN_ED25519_PUBLICKEYBYTES -> IO Int Source #

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

Helpers

c_sodium_compare :: Ptr a -> Ptr a -> CSize -> IO 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