packages feed

securemem 0.1.1 → 0.1.2

raw patch · 2 files changed

+15/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.SecureMem: secureMemCopy :: SecureMem -> IO SecureMem
+ Data.SecureMem: withSecureMemCopy :: SecureMem -> (Ptr Word8 -> IO ()) -> IO SecureMem

Files

Data/SecureMem.hs view
@@ -11,6 +11,7 @@ module Data.SecureMem     ( SecureMem     , secureMemGetSize+    , secureMemCopy     , ToSecureMem(..)     -- * Allocation and early termination     , allocateSecureMem@@ -20,6 +21,7 @@     -- * Pointers manipulation     , withSecureMemPtr     , withSecureMemPtrSz+    , withSecureMemCopy     -- * convertion     , secureMemFromByteString     ) where@@ -84,6 +86,18 @@                     B.memcpy dst sp sz                     return (dst `plusPtr` sz)           where sz = secureMemGetSize s++secureMemCopy :: SecureMem -> IO SecureMem+secureMemCopy src =+    createSecureMem sz $ \dst ->+    withSecureMemPtr src $ \s -> B.memcpy dst s sz+  where sz = secureMemGetSize src++withSecureMemCopy :: SecureMem -> (Ptr Word8 -> IO ()) -> IO SecureMem+withSecureMemCopy sm f = do+    sm2 <- secureMemCopy sm+    withSecureMemPtr sm2 f+    return sm2  instance Show SecureMem where     show _ = "<secure-mem>"
securemem.cabal view
@@ -1,5 +1,5 @@ Name:                securemem-Version:             0.1.1+Version:             0.1.2 Synopsis:            abstraction to an auto scrubbing and const time eq, memory chunk. Description:     SecureMem is similar to ByteString, except that it provides a memory chunk that