packages feed

raaz 0.3.11 → 0.3.12

raw patch · 5 files changed

+18/−8 lines, 5 filesdep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

- Implementation: copyKey :: Dest Internals -> Src (MemoryCell (Key ChaCha20)) -> IO ()
- Implementation: data Internals
- Implementation: instance Raaz.Core.Memory.Extractable {Implementation.Internals} (Raaz.Core.Primitive.BlockCount Raaz.Primitive.ChaCha20.Internal.ChaCha20)
- Implementation: instance Raaz.Core.Memory.Initialisable {Implementation.Internals} (Raaz.Core.Primitive.BlockCount Raaz.Primitive.ChaCha20.Internal.ChaCha20)
- Implementation: instance Raaz.Core.Memory.Memory {Implementation.Internals}
- Implementation: type BufferAlignment = 32
- Implementation: type Prim = ChaCha20
- Implementation: xchacha20Setup :: Nounce XChaCha20 -> Internals -> IO ()
- XChaCha20.Implementation: XChaCha20Mem :: MemoryCell (Key ChaCha20) -> Internals -> Internals
- XChaCha20.Implementation: [chacha20Internals] :: Internals -> Internals
- XChaCha20.Implementation: [copyOfKey] :: Internals -> MemoryCell (Key ChaCha20)
- XChaCha20.Implementation: additionalBlocks :: BlockCount XChaCha20
- XChaCha20.Implementation: data Internals
- XChaCha20.Implementation: description :: String
- XChaCha20.Implementation: instance Raaz.Core.Memory.Extractable XChaCha20.Implementation.Internals (Raaz.Core.Primitive.BlockCount Raaz.Primitive.ChaCha20.Internal.XChaCha20)
- XChaCha20.Implementation: instance Raaz.Core.Memory.Initialisable XChaCha20.Implementation.Internals (Raaz.Core.Primitive.BlockCount Raaz.Primitive.ChaCha20.Internal.XChaCha20)
- XChaCha20.Implementation: instance Raaz.Core.Memory.Initialisable XChaCha20.Implementation.Internals (Raaz.Core.Primitive.Key Raaz.Primitive.ChaCha20.Internal.XChaCha20)
- XChaCha20.Implementation: instance Raaz.Core.Memory.Initialisable XChaCha20.Implementation.Internals (Raaz.Core.Primitive.Nounce Raaz.Primitive.ChaCha20.Internal.XChaCha20)
- XChaCha20.Implementation: instance Raaz.Core.Memory.Memory XChaCha20.Implementation.Internals
- XChaCha20.Implementation: instance Raaz.Core.Memory.WriteAccessible XChaCha20.Implementation.Internals
- XChaCha20.Implementation: name :: String
- XChaCha20.Implementation: processBlocks :: BufferPtr -> BlockCount Prim -> Internals -> IO ()
- XChaCha20.Implementation: processLast :: BufferPtr -> BYTES Int -> Internals -> IO ()
- XChaCha20.Implementation: type BufferAlignment = BufferAlignment
- XChaCha20.Implementation: type BufferPtr = AlignedBlockPtr BufferAlignment Prim
- XChaCha20.Implementation: type Prim = XChaCha20
+ Raaz: class Encodable a
+ Raaz: class (IsString fmt, Show fmt, Encodable fmt) => Format fmt
+ Raaz: data Base16
+ Raaz: data Base64
+ Raaz: data family Nounce p
+ Raaz: decode :: (Format fmt, Encodable a) => fmt -> Maybe a
+ Raaz: decodeFormat :: Format fmt => fmt -> ByteString
+ Raaz: encode :: (Encodable a, Format fmt) => a -> fmt
+ Raaz: encodeByteString :: Format fmt => ByteString -> fmt
+ Raaz: fromBase16 :: Encodable a => String -> a
+ Raaz: fromByteString :: Encodable a => ByteString -> Maybe a
+ Raaz: showBase16 :: Encodable a => a -> String
+ Raaz: toByteString :: Encodable a => a -> ByteString
+ Raaz: translate :: (Format fmt1, Format fmt2) => fmt1 -> fmt2
+ Raaz: unsafeDecode :: (Format fmt, Encodable a) => fmt -> a
+ Raaz: unsafeFromByteString :: Encodable a => ByteString -> a
+ Raaz: version :: Version
+ Raaz: withMemory :: Memory mem => (mem -> IO a) -> IO a
+ Raaz: withSecureMemory :: Memory mem => (mem -> IO a) -> IO a
+ Raaz.Auth: auth :: PureByteSource src => Key Auth -> src -> Auth
+ Raaz.Auth: authFile :: Key Auth -> FilePath -> IO Auth
+ Raaz.Auth: authSource :: ByteSource src => Key Auth -> src -> IO Auth
+ Raaz.Auth: finaliseAuth :: forall (n :: Nat). KnownNat n => AuthCxt n -> IO Auth
+ Raaz.Auth: startAuth :: forall (n :: Nat). KnownNat n => Key Auth -> AuthCxt n -> IO ()
+ Raaz.Auth: type Auth = Auth
+ Raaz.Auth: type AuthCxt = AuthCxt
+ Raaz.Auth: updateAuth :: forall (n :: Nat) src. (KnownNat n, ByteSource src) => src -> AuthCxt n -> IO ()
+ Raaz.AuthEncrypt: lock :: Encodable plain => Key Cipher -> plain -> IO Locked
+ Raaz.AuthEncrypt: lockWith :: (Encodable plain, Encodable aad) => aad -> Key Cipher -> plain -> IO Locked
+ Raaz.AuthEncrypt: type Cipher = Prim
+ Raaz.AuthEncrypt: type Locked = AEAD Cipher AuthTag
+ Raaz.AuthEncrypt: unlock :: Encodable plain => Key Cipher -> Locked -> Maybe plain
+ Raaz.AuthEncrypt: unlockWith :: (Encodable plain, Encodable aad) => aad -> Key Cipher -> Locked -> Maybe plain
+ Raaz.AuthEncrypt.Unsafe: type AuthTag = Prim
+ Raaz.AuthEncrypt.Unsafe: type Cipher = Prim
+ Raaz.AuthEncrypt.Unsafe: type Locked = AEAD Cipher AuthTag
+ Raaz.AuthEncrypt.Unsafe: unsafeLock :: Encodable plain => Key Cipher -> Nounce Cipher -> plain -> Locked
+ Raaz.AuthEncrypt.Unsafe: unsafeLockWith :: (Encodable plain, Encodable aad) => aad -> Key Cipher -> Nounce Cipher -> plain -> Locked
+ Raaz.AuthEncrypt.Unsafe: unsafeLocked :: Nounce Cipher -> ByteString -> AuthTag -> Locked
+ Raaz.AuthEncrypt.Unsafe: unsafeToAuthTag :: Locked -> AuthTag
+ Raaz.AuthEncrypt.Unsafe: unsafeToCipherText :: Locked -> ByteString
+ Raaz.AuthEncrypt.Unsafe: unsafeToNounce :: Locked -> Nounce Cipher
+ Raaz.Digest: digest :: PureByteSource src => src -> Digest
+ Raaz.Digest: digestFile :: FilePath -> IO Digest
+ Raaz.Digest: digestSource :: ByteSource src => src -> IO Digest
+ Raaz.Digest: finaliseDigest :: forall (n :: Nat). KnownNat n => DigestCxt n -> IO Digest
+ Raaz.Digest: startDigest :: forall (n :: Nat). KnownNat n => DigestCxt n -> IO ()
+ Raaz.Digest: type Digest = Digest
+ Raaz.Digest: type DigestCxt (n :: Nat) = DigestCxt n
+ Raaz.Digest: updateDigest :: forall (n :: Nat) src. (KnownNat n, ByteSource src) => src -> DigestCxt n -> IO ()
+ Raaz.Random: ($dmrandom) :: (Random a, RandomStorable a) => RandomState -> IO a
+ Raaz.Random: class Random a
+ Raaz.Random: class Storable a => RandomStorable a
+ Raaz.Random: csprgDescription :: String
+ Raaz.Random: csprgName :: String
+ Raaz.Random: data RandomState
+ Raaz.Random: entropySource :: String
+ Raaz.Random: fillRandom :: (RandomStorable a, Pointer ptr) => Int -> ptr a -> RandomState -> IO ()
+ Raaz.Random: fillRandomBytes :: (LengthUnit l, Pointer ptr) => l -> Dest (ptr a) -> RandomState -> IO ()
+ Raaz.Random: fillRandomElements :: RandomStorable a => Int -> Ptr a -> RandomState -> IO ()
+ Raaz.Random: instance (Raaz.Core.Types.Tuple.Dimension d, Data.Vector.Unboxed.Base.Unbox w, Raaz.Random.Random w) => Raaz.Random.Random (Raaz.Core.Types.Tuple.Tuple d w)
+ Raaz.Random: instance (Raaz.Core.Types.Tuple.Dimension d, Data.Vector.Unboxed.Base.Unbox w, Raaz.Random.RandomStorable w) => Raaz.Random.RandomStorable (Raaz.Core.Types.Tuple.Tuple d w)
+ Raaz.Random: instance (Raaz.Random.Random a, Raaz.Random.Random b) => Raaz.Random.Random (a, b)
+ Raaz.Random: instance (Raaz.Random.Random a, Raaz.Random.Random b, Raaz.Random.Random c) => Raaz.Random.Random (a, b, c)
+ Raaz.Random: instance (Raaz.Random.Random a, Raaz.Random.Random b, Raaz.Random.Random c, Raaz.Random.Random d) => Raaz.Random.Random (a, b, c, d)
+ Raaz.Random: instance (Raaz.Random.Random a, Raaz.Random.Random b, Raaz.Random.Random c, Raaz.Random.Random d, Raaz.Random.Random e) => Raaz.Random.Random (a, b, c, d, e)
+ Raaz.Random: instance GHC.Internal.Foreign.Storable.Storable prim => Raaz.Random.Random (Raaz.Core.Primitive.Key (Raaz.Primitive.Keyed.Internal.Keyed prim))
+ Raaz.Random: instance Raaz.Random.Random (Raaz.Core.Primitive.Key Raaz.Primitive.ChaCha20.Internal.ChaCha20)
+ Raaz.Random: instance Raaz.Random.Random (Raaz.Core.Primitive.Key Raaz.Primitive.ChaCha20.Internal.XChaCha20)
+ Raaz.Random: instance Raaz.Random.Random (Raaz.Core.Primitive.Nounce Raaz.Primitive.ChaCha20.Internal.ChaCha20)
+ Raaz.Random: instance Raaz.Random.Random (Raaz.Core.Primitive.Nounce Raaz.Primitive.ChaCha20.Internal.XChaCha20)
+ Raaz.Random: instance Raaz.Random.Random GHC.Internal.Int.Int16
+ Raaz.Random: instance Raaz.Random.Random GHC.Internal.Int.Int32
+ Raaz.Random: instance Raaz.Random.Random GHC.Internal.Int.Int64
+ Raaz.Random: instance Raaz.Random.Random GHC.Internal.Int.Int8
+ Raaz.Random: instance Raaz.Random.Random GHC.Internal.Word.Word16
+ Raaz.Random: instance Raaz.Random.Random GHC.Internal.Word.Word32
+ Raaz.Random: instance Raaz.Random.Random GHC.Internal.Word.Word64
+ Raaz.Random: instance Raaz.Random.Random GHC.Internal.Word.Word8
+ Raaz.Random: instance Raaz.Random.Random Raaz.Primitive.Poly1305.Internal.R
+ Raaz.Random: instance Raaz.Random.Random w => Raaz.Random.Random (Raaz.Core.Types.Endian.BE w)
+ Raaz.Random: instance Raaz.Random.Random w => Raaz.Random.Random (Raaz.Core.Types.Endian.LE w)
+ Raaz.Random: instance Raaz.Random.RandomStorable (Raaz.Core.Primitive.Key Raaz.Primitive.ChaCha20.Internal.ChaCha20)
+ Raaz.Random: instance Raaz.Random.RandomStorable (Raaz.Core.Primitive.Key Raaz.Primitive.ChaCha20.Internal.XChaCha20)
+ Raaz.Random: instance Raaz.Random.RandomStorable (Raaz.Core.Primitive.Nounce Raaz.Primitive.ChaCha20.Internal.ChaCha20)
+ Raaz.Random: instance Raaz.Random.RandomStorable (Raaz.Core.Primitive.Nounce Raaz.Primitive.ChaCha20.Internal.XChaCha20)
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Internal.Int.Int16
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Internal.Int.Int32
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Internal.Int.Int64
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Internal.Int.Int8
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Internal.Word.Word16
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Internal.Word.Word32
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Internal.Word.Word64
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Internal.Word.Word8
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Types.Int
+ Raaz.Random: instance Raaz.Random.RandomStorable GHC.Types.Word
+ Raaz.Random: instance Raaz.Random.RandomStorable Raaz.Primitive.Poly1305.Internal.R
+ Raaz.Random: instance Raaz.Random.RandomStorable w => Raaz.Random.RandomStorable (Raaz.Core.Types.Endian.BE w)
+ Raaz.Random: instance Raaz.Random.RandomStorable w => Raaz.Random.RandomStorable (Raaz.Core.Types.Endian.LE w)
+ Raaz.Random: random :: Random a => RandomState -> IO a
+ Raaz.Random: randomByteString :: LengthUnit l => l -> RandomState -> IO ByteString
+ Raaz.Random: randomiseMemory :: WriteAccessible mem => mem -> RandomState -> IO ()
+ Raaz.Random: reseed :: RandomState -> IO ()
+ Raaz.Random: unsafeFillRandomElements :: Storable a => Int -> Ptr a -> RandomState -> IO ()
+ Raaz.Random: withRandomState :: (RandomState -> IO a) -> IO a
+ Raaz.Random: withRandomisedMemory :: WriteAccessible mem => (mem -> IO a) -> IO a
+ Raaz.Random: withSecureRandomState :: Memory mem => (mem -> RandomState -> IO a) -> IO a
+ Raaz.Random: withSecureRandomisedMemory :: WriteAccessible mem => (mem -> IO a) -> IO a

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Change log for [raaz]. +## [0.3.12] - Aug 20, 2026++Release that supports ghc-9.14 (base 4.22)+ ## [0.3.11] - Feb 18, 2025  Release that supports ghc-9.12 (base 4.21)@@ -218,4 +222,5 @@ [0.3.9]: <http://github.com/raaz-crypto/raaz/releases/tag/v0.3.9> [0.3.10]: <http://github.com/raaz-crypto/raaz/releases/tag/v0.3.10> [0.3.11]: <http://github.com/raaz-crypto/raaz/releases/tag/v0.3.11>+[0.3.12]: <http://github.com/raaz-crypto/raaz/releases/tag/v0.3.12> [raaz]:  <http://github.com/raaz-crypto/raaz/>
core/Raaz/Core/Types/Endian.hs view
@@ -4,7 +4,6 @@ {-# LANGUAGE MultiParamTypeClasses      #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE FlexibleInstances          #-}-{-# LANGUAGE DeriveDataTypeable         #-} {-# LANGUAGE TypeFamilies               #-}  -- | Endian safe types.@@ -239,7 +238,7 @@ newtype LE w = LE { unLE :: w }     deriving ( Bounded, Enum, Read, Show              , Integral, Num, Real, Eq, Equality, Ord-             , Bits, Storable, Typeable, NFData+             , Bits, Storable, NFData              )  instance Functor LE where@@ -249,7 +248,7 @@ newtype BE w = BE { unBE :: w }     deriving ( Bounded, Enum, Read, Show              , Integral, Num, Real, Eq, Equality, Ord-             , Bits, Storable, Typeable, NFData+             , Bits, Storable, NFData              )  instance Functor BE where
implementation/ChaCha20/CPortable.hs view
@@ -7,7 +7,6 @@ import qualified Data.Vector.Unboxed as V  import           Raaz.Core-import           Raaz.Core.Types.Internal import           Raaz.Primitive.ChaCha20.Internal import           Raaz.Verse.ChaCha20.C.Portable @@ -57,7 +56,14 @@   -- from the hchacha20 hash. We also set the ivcell appropriately   initialise iv $ ivCell mem   where keyPtr = castPtr $ keyCellPtr mem-        [LE h0,LE h1,LE h2, LE h3, h4, h5] = V.toList $ unsafeToVector tup+        vec = unsafeToVector tup+        wrd = V.unsafeIndex vec+        h0  = unLE $ wrd 0+        h1  = unLE $ wrd 1+        h2  = unLE $ wrd 2+        h3  = unLE $ wrd 3+        h4  = wrd 4+        h5  = wrd 5         iv  = Nounce $ unsafeFromList [0, h4, h5] :: Nounce ChaCha20  
implementation/entropy/windows/Entropy.hsc view
@@ -12,7 +12,7 @@ ## error Unknown mingw32 arch ##endif -import Foreign.Ptr (Ptr(), nullPtr, castPtr)+import Foreign.Ptr (nullPtr, castPtr) import Foreign.Storable (peek) import Foreign.C.String (CWString()) import Raaz.Core.Prelude
raaz.cabal view
@@ -1,7 +1,7 @@ cabal-version: 3.0  name:    raaz-version: 0.3.11+version: 0.3.12 stability: experimental  synopsis: Fast and type safe cryptography.@@ -195,7 +195,7 @@   default-language: Haskell2010   ghc-options: -Wall   default-extensions: NoImplicitPrelude-  build-depends: base                    >= 4.11 &&  < 4.22+  build-depends: base                    >= 4.11 &&  < 4.23                , bytestring              >= 0.10 &&  < 0.13                , deepseq                 >= 1.4  &&  < 1.6                , vector                  >= 0.12 &&  < 0.14