packages feed

raaz 0.2.0 → 0.2.1

raw patch · 10 files changed

+89/−9 lines, 10 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Raaz.Core.ByteSource: instance Raaz.Core.ByteSource.ByteSource src => Raaz.Core.ByteSource.ByteSource (GHC.Base.Maybe src)
- Raaz.Core.ByteSource: instance Raaz.Core.ByteSource.PureByteSource src => Raaz.Core.ByteSource.PureByteSource (GHC.Base.Maybe src)
- Raaz.Core.Types: Dest :: a -> Dest a
- Raaz.Core.Types: Src :: a -> Src a
- Raaz.Core.Types: [unDest] :: Dest a -> a
- Raaz.Core.Types: [unSrc] :: Src a -> a
- Raaz.Core.Types: newtype Dest a
- Raaz.Core.Types: newtype Src a
+ Raaz.Core.ByteSource: instance Raaz.Core.ByteSource.ByteSource src => Raaz.Core.ByteSource.ByteSource (GHC.Maybe.Maybe src)
+ Raaz.Core.ByteSource: instance Raaz.Core.ByteSource.PureByteSource src => Raaz.Core.ByteSource.PureByteSource (GHC.Maybe.Maybe src)
+ Raaz.Core.MonoidalAction: instance Raaz.Core.MonoidalAction.Distributive m space => GHC.Base.Semigroup (Raaz.Core.MonoidalAction.SemiR space m)
+ Raaz.Core.Primitives: -- | Associated type that captures an implementation of this primitive.
+ Raaz.Core.Primitives: instance GHC.Base.Semigroup (Raaz.Core.Primitives.BLOCKS p)
+ Raaz.Core.Transfer: instance GHC.Base.Monad m => GHC.Base.Semigroup (Raaz.Core.Transfer.ReadM m)
+ Raaz.Core.Transfer: instance GHC.Base.Monad m => GHC.Base.Semigroup (Raaz.Core.Transfer.TransferM m)
+ Raaz.Core.Transfer: instance GHC.Base.Monad m => GHC.Base.Semigroup (Raaz.Core.Transfer.WriteM m)
+ Raaz.Core.Types: data Dest a
+ Raaz.Core.Types: data Src a
- Raaz.Cipher: aes128cbc :: AES 128 CBC
+ Raaz.Cipher: aes128cbc :: AES 128 'CBC
- Raaz.Cipher: aes192cbc :: AES 192 CBC
+ Raaz.Cipher: aes192cbc :: AES 192 'CBC
- Raaz.Cipher: aes256cbc :: AES 256 CBC
+ Raaz.Cipher: aes256cbc :: AES 256 'CBC
- Raaz.Cipher.AES: aes128cbc :: AES 128 CBC
+ Raaz.Cipher.AES: aes128cbc :: AES 128 'CBC
- Raaz.Cipher.AES: aes128ctr :: AES 128 CTR
+ Raaz.Cipher.AES: aes128ctr :: AES 128 'CTR
- Raaz.Cipher.AES: aes192cbc :: AES 192 CBC
+ Raaz.Cipher.AES: aes192cbc :: AES 192 'CBC
- Raaz.Cipher.AES: aes256cbc :: AES 256 CBC
+ Raaz.Cipher.AES: aes256cbc :: AES 256 'CBC
- Raaz.Cipher.AES.CBC.Implementation.CPortable: aes128cbcI :: Implementation (AES 128 CBC)
+ Raaz.Cipher.AES.CBC.Implementation.CPortable: aes128cbcI :: Implementation (AES 128 'CBC)
- Raaz.Cipher.AES.CBC.Implementation.CPortable: aes192cbcI :: Implementation (AES 192 CBC)
+ Raaz.Cipher.AES.CBC.Implementation.CPortable: aes192cbcI :: Implementation (AES 192 'CBC)
- Raaz.Cipher.AES.CBC.Implementation.CPortable: aes256cbcI :: Implementation (AES 256 CBC)
+ Raaz.Cipher.AES.CBC.Implementation.CPortable: aes256cbcI :: Implementation (AES 256 'CBC)
- Raaz.Cipher.Internal: SomeCipherI :: (CipherI cipher encMem decMem) -> SomeCipherI cipher
+ Raaz.Cipher.Internal: SomeCipherI :: CipherI cipher encMem decMem -> SomeCipherI cipher
- Raaz.Core.ByteSource: Exhausted :: (BYTES Int) -> FillResult a
+ Raaz.Core.ByteSource: Exhausted :: BYTES Int -> FillResult a
- Raaz.Core.Encode: class Encodable a where toByteString w = unsafeCreate (fromEnum $ sizeOf w) putit where putit ptr = store (castPtr ptr) w fromByteString bs | sizeOf proxy == length bs = Just w | otherwise = Nothing where w = unsafePerformIO $ withByteString bs (load . castPtr) proxy = undefined `asTypeOf` w unsafeFromByteString = fromMaybe (error "fromByteString error") . fromByteString
+ Raaz.Core.Encode: class Encodable a
- Raaz.Core.MonoidalAction: TwistRF :: (f a) -> !m -> TwistRF f m a
+ Raaz.Core.MonoidalAction: TwistRF :: f a -> !m -> TwistRF f m a
- Raaz.Core.MonoidalAction: infixr 5 <++>
+ Raaz.Core.MonoidalAction: infixr 5 <<.>>
- Raaz.Core.Primitives: class BlockAlgorithm (Implementation p) => Primitive p where type Implementation p :: * where {
+ Raaz.Core.Primitives: class BlockAlgorithm (Implementation p) => Primitive p where {
- Raaz.Core.Primitives: type family Implementation p :: *;
+ Raaz.Core.Primitives: type family Key prim :: *
- Raaz.Hash.Internal: SomeHashI :: (HashI h m) -> SomeHashI h
+ Raaz.Hash.Internal: SomeHashI :: HashI h m -> SomeHashI h

Files

CHANGELOG.md view
@@ -1,5 +1,11 @@ # Change log for [raaz]. +## [0.2.1] - 25 March, 2019++This is a minor release just to get the latest ghc.++* Get raaz to work with latest ghcs.+ ## [0.2.0] - 24 August, 2017  * Some cpu detection builtin for GCC. Would come handy in future for@@ -67,4 +73,5 @@ [0.1.0]: <http://github.com/raaz-crypto/raaz/releases/tag/v0.1.0> [0.1.1]: <http://github.com/raaz-crypto/raaz/releases/tag/v0.1.1> [0.2.0]: <http://github.com/raaz-crypto/raaz/releases/tag/v0.2.0>+[0.2.1]: <http://github.com/raaz-crypto/raaz/releases/tag/v0.2.1> [raaz]:  <http://github.com/raaz-crypto/raaz/>
Raaz/Core/Encode/Base16.hs view
@@ -1,5 +1,6 @@ -- | Base 16 or hexadecimal encoding of objects. {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE CPP                        #-} module Raaz.Core.Encode.Base16        ( Base16        , fromBase16, showBase16@@ -28,7 +29,12 @@ -- are exposed mainly to make these definitions easy. -- -newtype Base16 = Base16 {unBase16 :: ByteString} deriving (Eq, Monoid)+newtype Base16 = Base16 {unBase16 :: ByteString}+#if MIN_VERSION_base(4,11,0)+                 deriving (Eq, Semigroup, Monoid)+#else+                 deriving (Eq, Monoid)+#endif  -- Developers note: Internally base16 just stores the bytestring as -- is. The conversion happens when we do an encode and decode of
Raaz/Core/Encode/Base64.hs view
@@ -1,5 +1,6 @@ -- | Base 64 encoding of objects. {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE CPP                        #-} module Raaz.Core.Encode.Base64( Base64 ) where  import Data.Char@@ -18,7 +19,13 @@  -- | The type corresponding to the standard padded base-64 binary -- encoding.-newtype Base64 = Base64 {unBase64 :: ByteString} deriving (Eq, Monoid)+newtype Base64 = Base64 {unBase64 :: ByteString}+#if MIN_VERSION_base(4,11,0)+                 deriving (Eq, Semigroup, Monoid)+#else+                 deriving (Eq, Monoid)+#endif+  -- Developers note: Internally base16 just stores the bytestring as -- is. The conversion happens when we do an encode and decode of
Raaz/Core/MonoidalAction.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE MultiParamTypeClasses      #-} {-# LANGUAGE FlexibleInstances          #-}+{-# LANGUAGE CPP                        #-}  -- | A module that abstracts out monoidal actions. module Raaz.Core.MonoidalAction@@ -90,6 +91,12 @@ -- a semidirect product. data SemiR space m = SemiR space !m +#if MIN_VERSION_base(4,11,0)++instance Distributive m space => Semigroup (SemiR space m) where+  (<>) (SemiR x a) (SemiR y b) = SemiR (x `mappend`  (a <.> y))  (a `mappend` b)++#endif  instance Distributive m space => Monoid (SemiR space m) where 
Raaz/Core/Primitives.hs view
@@ -93,6 +93,11 @@ newtype BLOCKS p = BLOCKS {unBLOCKS :: Int}                  deriving (Show, Eq, Ord, Enum) +#if MIN_VERSION_base(4,11,0)+instance Semigroup (BLOCKS p) where+  (<>) x y = BLOCKS $ unBLOCKS x + unBLOCKS y+#endif+ instance Monoid (BLOCKS p) where   mempty      = BLOCKS 0   mappend x y = BLOCKS $ unBLOCKS x + unBLOCKS y
Raaz/Core/Transfer.hs view
@@ -5,7 +5,7 @@ {-# LANGUAGE FlexibleInstances          #-} {-# LANGUAGE MultiParamTypeClasses      #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-}-+{-# LANGUAGE CPP                        #-}  module Raaz.Core.Transfer        ( -- * Transfer actions.@@ -64,6 +64,12 @@ -- | This monoid captures a transfer action. newtype TransferM m = TransferM { unTransferM :: m () } +#if MIN_VERSION_base(4,11,0)+instance Monad m => Semigroup (TransferM m) where+  (<>) wa wb = TransferM $ unTransferM wa >> unTransferM wb+#endif++ instance Monad m => Monoid (TransferM m) where   mempty        = TransferM $ return ()   {-# INLINE mempty #-}@@ -99,8 +105,14 @@ -- | An element of type `WriteM m` is an action which when executed transfers bytes -- /into/ its input buffer.  The type @`WriteM` m@ forms a monoid and -- hence can be concatnated using the `<>` operator.-newtype WriteM m = WriteM { unWriteM :: Transfer m } deriving Monoid+newtype WriteM m = WriteM { unWriteM :: Transfer m }+#if MIN_VERSION_base(4,11,0)+                 deriving (Semigroup, Monoid)+#else+                 deriving Monoid+#endif + -- | A write io-action. type WriteIO = WriteM IO @@ -258,7 +270,12 @@ -- data associated from @r1@ and then the read associated with the -- data @r2@. -newtype ReadM m = ReadM { unReadM :: Transfer m} deriving Monoid+newtype ReadM m = ReadM { unReadM :: Transfer m}+#if MIN_VERSION_base(4,11,0)+                 deriving (Semigroup, Monoid)+#else+                 deriving Monoid+#endif  -- | A read io-action. type ReadIO = ReadM IO
Raaz/Core/Types/Equality.hs view
@@ -261,6 +261,11 @@ -- AND of two comparisons in a timing safe way. newtype Result =  Result { unResult :: Word } +#if MIN_VERSION_base(4,11,0)+instance Semigroup Result where+    (<>) a b = Result (unResult a .|. unResult b)+#endif+ instance Monoid Result where   mempty      = Result 0   mappend a b = Result (unResult a .|. unResult b)
Raaz/Core/Types/Pointer.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP                        #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses      #-} {-# LANGUAGE FlexibleInstances          #-}@@ -122,11 +123,24 @@                  deriving ( Show, Eq,Ord, Enum, Integral                           , Real, Num, Storable                           )+#if MIN_VERSION_base(4,11,0) +instance Num a => Semigroup (BYTES a) where+  (<>) = (+)++#endif+ instance Num a => Monoid (BYTES a) where   mempty  = 0   mappend = (+) +#if MIN_VERSION_base(4,11,0)++instance Semigroup ALIGN where+  (<>) x y = ALIGN $ unALIGN x + unALIGN y++#endif+ instance Monoid ALIGN where   mempty  = ALIGN 0   mappend x y = ALIGN $ unALIGN x + unALIGN y@@ -237,6 +251,12 @@ -- | The default alignment to use is word boundary. wordAlignment :: Alignment wordAlignment = alignment (undefined :: Align)++#if MIN_VERSION_base(4,11,0)++instance Semigroup Alignment where+  (<>) = lcm+#endif  instance Monoid Alignment where   mempty  = Alignment 1
Raaz/Hash/Internal/HMAC.hs view
@@ -1,6 +1,6 @@ -- |The HMAC construction for a cryptographic hash -+{-# LANGUAGE CPP                        #-} {-# LANGUAGE TypeFamilies               #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleContexts           #-}@@ -56,7 +56,12 @@ -- are shortened by applying the appropriate hash. As a result the -- `show` and `fromString` need not be inverses of each other. ---newtype HMACKey h = HMACKey { unKey :: B.ByteString } deriving Monoid+newtype HMACKey h = HMACKey { unKey :: B.ByteString }+#if MIN_VERSION_base(4,11,0)+                 deriving (Semigroup, Monoid)+#else+                 deriving Monoid+#endif  instance (Hash h, Recommendation h) => Storable (HMACKey h) where 
raaz.cabal view
@@ -1,5 +1,5 @@ name:    raaz-version: 0.2.0+version: 0.2.1  synopsis: The raaz cryptographic library. @@ -170,7 +170,7 @@                , Raaz.Random.ChaCha20PRG                , Raaz.Entropy                , Paths_raaz-  build-depends: base                           >= 4.6  &&  < 4.11+  build-depends: base                           >= 4.6  &&  < 4.13                , bytestring                     >= 0.9  &&  < 0.11                , deepseq                        >= 1.1  &&  < 1.5                , vector                         >= 0.7.1 && < 0.13@@ -335,6 +335,7 @@                , transformers                , raaz                , vector+  build-tool-depends: hspec-discover:hspec-discover  -------------------------- Liquid haskell verification -------------------------------------