securemem 0.1.9 → 0.1.10
raw patch · 4 files changed
+16/−32 lines, 4 filesdep ~base
Dependency ranges changed: base
Files
- Data/SecureMem.hs +13/−0
- LICENSE +1/−1
- README.md +0/−28
- securemem.cabal +2/−3
Data/SecureMem.hs view
@@ -31,7 +31,12 @@ import Foreign.ForeignPtr (withForeignPtr) import Foreign.Ptr import Data.Word (Word8)+#if MIN_VERSION_base(4,9,0)+import Data.Semigroup+import Data.Foldable (toList)+#else import Data.Monoid+#endif import Control.Applicative import Data.Byteable @@ -96,10 +101,18 @@ instance Eq SecureMem where (==) = secureMemEq +#if MIN_VERSION_base(4,9,0)+instance Semigroup SecureMem where+ (<>) = secureMemAppend+ sconcat = secureMemConcat . toList+#endif+ instance Monoid SecureMem where mempty = unsafeCreateSecureMem 0 (\_ -> return ())+#if !(MIN_VERSION_base(4,11,0)) mappend = secureMemAppend mconcat = secureMemConcat+#endif -- | Types that can be converted to a secure mem object. class ToSecureMem a where
LICENSE view
@@ -1,4 +1,4 @@-Copyright (c) 2013-2014 Vincent Hanquez <vincent@snarc.org>+Copyright (c) 2013-2018 Vincent Hanquez <vincent@snarc.org> All rights reserved.
− README.md
@@ -1,28 +0,0 @@-securemem-=========--[](https://travis-ci.org/vincenthz/hs-securemem)-[](http://en.wikipedia.org/wiki/BSD_licenses)-[](http://haskell.org)--Securemem provides memory chunks that allow auto-scrubbing of the memory after use,-and constant time equality.--Documentation: [securemem on hackage](http://hackage.haskell.org/package/securemem)--Interacting with securemem-----------------------------It's recommended to use the [Byteable instance](http://hackage.haskell.org/package/byteable)-when providing an interface that takes a securemem. It allow legacy code, and work in progress-code to interface with securemem more easily.--older base-------------On older base, the memory is not scrubbed: upgrade your GHC to 7.6.0 or above.--TODO-------* add a custom memory allocator that give mlocked memory chunks.
securemem.cabal view
@@ -1,5 +1,5 @@ Name: securemem-Version: 0.1.9+Version: 0.1.10 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@@ -12,9 +12,8 @@ Category: Data Stability: experimental Build-Type: Simple-Homepage: http://github.com/vincenthz/hs-securemem+Homepage: https://github.com/vincenthz/hs-securemem Cabal-Version: >=1.8-extra-doc-files: README.md Library Exposed-modules: Data.SecureMem