threefish 0.2.1 → 0.2.2
raw patch · 2 files changed
+32/−1 lines, 2 files
Files
- Crypto/Threefish/Skein/Internal.hs +30/−0
- threefish.cabal +2/−1
+ Crypto/Threefish/Skein/Internal.hs view
@@ -0,0 +1,30 @@+{-# LANGUAGE ForeignFunctionInterface #-}+-- | Skein FFI internals.+module Crypto.Threefish.Skein.Internal where+import Foreign.ForeignPtr+import Foreign.Ptr+import Data.Word+ +newtype Skein256Ctx = Skein256Ctx (ForeignPtr Word64)++foreign import ccall unsafe skein256_init+ :: Ptr Word64 -- ^ Skein 256 context to initialize.+ -> Ptr Word64 -- ^ Desired key or nullPtr.+ -> Word64 -- ^ Output size in bits.+ -> IO ()++foreign import ccall unsafe skein256_update+ :: Ptr Word64 -- ^ Skein 256 context.+ -> Int -- ^ First/last update? First starts a new tweak.+ -- (First bit indicates first, second bit indicates last.)+ -> Int -- ^ Type of block, as given by type2int.+ -> Word64 -- ^ Length of block. Must be multiple of 32 except for last.+ -> Ptr Word64 -- ^ Pointer to update data.+ -> IO ()++foreign import ccall unsafe skein256_output+ :: Ptr Word64 -- ^ Skein 256 context.+ -> Int -- ^ First output block to get.+ -> Int -- ^ Last output block to get.+ -> Ptr Word64 -- ^ Pointer to store output data in.+ -> IO ()
threefish.cabal view
@@ -1,5 +1,5 @@ name: threefish-version: 0.2.1+version: 0.2.2 synopsis: The Threefish block cipher and the Skein hash function for Haskell. description: Implements 256 and 512 bit variants of Threefish and Skein. Skein is usable as a "normal" hash function as well as in Skein-MAC, as a cryptographically secure PRNG, as a stream cipher and as a key derivation function, all implemented according to the specifications of the Skein 1.3 paper. homepage: http://github.com/valderman/threefish@@ -23,6 +23,7 @@ Crypto.Threefish.Authenticated, Crypto.Threefish.Random, Crypto.Threefish.Skein,+ Crypto.Threefish.Skein.Internal, Crypto.Threefish.Skein.KDF, Crypto.Threefish.Skein.StreamCipher other-modules: