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

Cardano.Foreign

Description

Utilities for FFI

Synopsis

Sized pointer

newtype SizedPtr (n ∷ Nat) Source #

Constructors

SizedPtr (Ptr Void) 

allocaSized ∷ ∀ n b. KnownNat n ⇒ (SizedPtr n → IO b) → IO b Source #

memcpySized ∷ ∀ n. KnownNat n ⇒ SizedPtr n → SizedPtr n → IO () Source #

memsetSized ∷ ∀ n. KnownNat n ⇒ SizedPtr n → Word8IO () Source #

Low-level C functions

c_memcpyPtr a → Ptr a → CSizeIO (Ptr ()) Source #

void *memcpy(void *dest, const void *src, size_t n);

Note: this is safe foreign import

c_memsetPtr a → IntCSizeIO (Ptr ()) Source #

void *memset(void *s, int c, size_t n);

Note: for sure zeroing memory use c_sodium_memzero.