| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
Cardano.Crypto.Libsodium.MLockedBytes
Synopsis
- data MLockedSizedBytes n
 - mlsbZero :: forall n. KnownNat n => MLockedSizedBytes n
 - mlsbFromByteString :: forall n. KnownNat n => ByteString -> MLockedSizedBytes n
 - mlsbFromByteStringCheck :: forall n. KnownNat n => ByteString -> Maybe (MLockedSizedBytes n)
 - mlsbToByteString :: forall n. KnownNat n => MLockedSizedBytes n -> ByteString
 - mlsbUseAsCPtr :: MLockedSizedBytes n -> (Ptr Word8 -> IO r) -> IO r
 - mlsbUseAsSizedPtr :: MLockedSizedBytes n -> (SizedPtr n -> IO r) -> IO r
 - mlsbFinalize :: MLockedSizedBytes n -> IO ()
 
Documentation
data MLockedSizedBytes n Source #
Instances
mlsbZero :: forall n. KnownNat n => MLockedSizedBytes n Source #
Note: this doesn't need to allocate mlocked memory, but we do that for consistency
mlsbFromByteString :: forall n. KnownNat n => ByteString -> MLockedSizedBytes n Source #
mlsbFromByteStringCheck :: forall n. KnownNat n => ByteString -> Maybe (MLockedSizedBytes n) Source #
mlsbToByteString :: forall n. KnownNat n => MLockedSizedBytes n -> ByteString Source #
Note: the resulting ByteString will still refer to secure memory,
 but the types don't prevent it from be exposed.
mlsbUseAsCPtr :: MLockedSizedBytes n -> (Ptr Word8 -> IO r) -> IO r Source #
mlsbUseAsSizedPtr :: MLockedSizedBytes n -> (SizedPtr n -> IO r) -> IO r Source #
mlsbFinalize :: MLockedSizedBytes n -> IO () Source #
Calls finalizeMLockedForeignPtr on underlying pointer.
 This function invalidates argument.