ppad-chacha 0.2.0 → 0.2.1
raw patch · 3 files changed
+17/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Crypto.Cipher.ChaCha20: InvalidKey :: Error
+ Crypto.Cipher.ChaCha20: InvalidNonce :: Error
+ Crypto.Cipher.ChaCha20: data Error
Files
- CHANGELOG +3/−0
- lib/Crypto/Cipher/ChaCha20.hs +5/−4
- ppad-chacha.cabal +9/−2
CHANGELOG view
@@ -1,5 +1,8 @@ # Changelog +- 0.2.1 (2025-12-28)+ * Adds an 'llvm' build flag and tests with GHC 9.10.3.+ - 0.2.0 (2025-06-21) * Both the ChaCha block function and stream cipher are now total, returning values of 'Left InvalidKey' or 'Left InvalidNonce' when
lib/Crypto/Cipher/ChaCha20.hs view
@@ -269,9 +269,10 @@ PA.writePrimArray s idx (iv + sv) serialize state +-- | Error values. data Error =- InvalidKey- | InvalidNonce+ InvalidKey -- ^ the provided key was not 256 bits long+ | InvalidNonce -- ^ the provided nonce was none 96 bits long deriving (Eq, Show) -- RFC8439 2.3@@ -359,8 +360,8 @@ state@(ChaCha s) <- _chacha_alloc let loop acc !j bs = case BS.splitAt 64 bs of- (chunk@(BI.PS _ _ l), etc)- | l == 0 && BS.length etc == 0 -> pure $ -- XX+ (chunk@(BI.PS _ _ l), etc@(BI.PS _ _ le))+ | l == 0 && le == 0 -> pure $ BS.toStrict (BSB.toLazyByteString acc) | otherwise -> do PA.copyMutablePrimArray s 0 initial 0 16
ppad-chacha.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: ppad-chacha-version: 0.2.0+version: 0.2.1 synopsis: A pure ChaCha20 stream cipher license: MIT license-file: LICENSE@@ -8,11 +8,16 @@ maintainer: jared@ppad.tech category: Cryptography build-type: Simple-tested-with: GHC == 9.8.1+tested-with: GHC == 9.10.3 extra-doc-files: CHANGELOG description: A pure ChaCha20 stream cipher and block function. +flag llvm+ description: Use GHC's LLVM backend.+ default: False+ manual: True+ source-repository head type: git location: git.ppad.tech/chacha.git@@ -22,6 +27,8 @@ hs-source-dirs: lib ghc-options: -Wall+ if flag(llvm)+ ghc-options: -fllvm -O2 exposed-modules: Crypto.Cipher.ChaCha20 build-depends: