packages feed

crypto-api 0.12 → 0.12.1

raw patch · 3 files changed

+14/−1 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Crypto.Classes: keyLengthBytes :: BlockCipher k => Tagged k ByteLength
+ Crypto.Util: i2bs_unsized :: Integer -> ByteString

Files

Crypto/Classes.hs view
@@ -21,6 +21,7 @@         -- * Cipher classes and helper functions         , BlockCipher(..)         , blockSizeBytes+        , keyLengthBytes         , buildKeyIO         , StreamCipher(..)         , buildStreamKeyIO@@ -173,6 +174,11 @@ -- |The number of bytes in a block cipher block blockSizeBytes :: (BlockCipher k) => Tagged k ByteLength blockSizeBytes = fmap (`div` 8) blockSize++-- |The number of bytes in a block cipher key (assuming it is an even+-- multiple of 8 bits)+keyLengthBytes :: (BlockCipher k) => Tagged k ByteLength+keyLengthBytes = fmap (`div` 8) keyLength  -- |Build a symmetric key using the system entropy (see 'System.Crypto.Random') buildKeyIO :: (BlockCipher k) => IO k
Crypto/Util.hs view
@@ -27,6 +27,13 @@ i2bs l i = B.unfoldr (\l' -> if l' < 0 then Nothing else Just (fromIntegral (i `shiftR` l'), l' - 8)) (l-8) {-# INLINE i2bs #-} +-- |@i2bs_unsized i@ converts @i@ to a 'ByteString' of sufficient bytes to express the integer.+-- The integer must be non-negative and a zero will be encoded in one byte.+i2bs_unsized :: Integer -> B.ByteString+i2bs_unsized 0 = B.singleton 0+i2bs_unsized i = B.reverse $ B.unfoldr (\i' -> if i' <= 0 then Nothing else Just (fromIntegral i', (i' `shiftR` 8))) i+{-# INLINE i2bs_unsized #-}+ -- | Useful utility to extract the result of a generator operation -- and translate error results to exceptions. throwLeft :: Exception e => Either e a -> a
crypto-api.cabal view
@@ -1,5 +1,5 @@ name:           crypto-api-version:        0.12+version:        0.12.1 license:        BSD3 license-file:   LICENSE copyright:      Thomas DuBuisson <thomas.dubuisson@gmail.com>