cardano-crypto-class-2.0.0.0.0.0.0.2: 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 :: forall n b. KnownNat n => (SizedPtr n -> IO b) -> IO b Source #

memcpySized :: forall n. KnownNat n => SizedPtr n -> SizedPtr n -> IO () Source #

memsetSized :: forall n. KnownNat n => SizedPtr n -> Word8 -> IO () Source #

Low-level C functions

c_memcpy :: Ptr a -> Ptr a -> CSize -> IO (Ptr ()) Source #

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

Note: this is safe foreign import

c_memset :: Ptr a -> Int -> CSize -> IO (Ptr ()) Source #

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

Note: for sure zeroing memory use c_sodium_memzero.