cacophony 0.9.0 → 0.9.1
raw patch · 4 files changed
+35/−9 lines, 4 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Crypto.Noise: hoLocalEphemeral :: forall d_atsV. Lens' (HandshakeOpts d_atsV) (Maybe (KeyPair d_atsV))
+ Crypto.Noise: hoLocalEphemeral :: forall d_atxd. Lens' (HandshakeOpts d_atxd) (Maybe (KeyPair d_atxd))
- Crypto.Noise: hoLocalSemiEphemeral :: forall d_atsV. Lens' (HandshakeOpts d_atsV) (Maybe (KeyPair d_atsV))
+ Crypto.Noise: hoLocalSemiEphemeral :: forall d_atxd. Lens' (HandshakeOpts d_atxd) (Maybe (KeyPair d_atxd))
- Crypto.Noise: hoLocalStatic :: forall d_atsV. Lens' (HandshakeOpts d_atsV) (Maybe (KeyPair d_atsV))
+ Crypto.Noise: hoLocalStatic :: forall d_atxd. Lens' (HandshakeOpts d_atxd) (Maybe (KeyPair d_atxd))
- Crypto.Noise: hoPattern :: forall d_atsV. Lens' (HandshakeOpts d_atsV) HandshakePattern
+ Crypto.Noise: hoPattern :: forall d_atxd. Lens' (HandshakeOpts d_atxd) HandshakePattern
- Crypto.Noise: hoPreSharedKey :: forall d_atsV. Lens' (HandshakeOpts d_atsV) (Maybe Plaintext)
+ Crypto.Noise: hoPreSharedKey :: forall d_atxd. Lens' (HandshakeOpts d_atxd) (Maybe Plaintext)
- Crypto.Noise: hoPrologue :: forall d_atsV. Lens' (HandshakeOpts d_atsV) Plaintext
+ Crypto.Noise: hoPrologue :: forall d_atxd. Lens' (HandshakeOpts d_atxd) Plaintext
- Crypto.Noise: hoRemoteEphemeral :: forall d_atsV. Lens' (HandshakeOpts d_atsV) (Maybe (PublicKey d_atsV))
+ Crypto.Noise: hoRemoteEphemeral :: forall d_atxd. Lens' (HandshakeOpts d_atxd) (Maybe (PublicKey d_atxd))
- Crypto.Noise: hoRemoteSemiEphemeral :: forall d_atsV. Lens' (HandshakeOpts d_atsV) (Maybe (PublicKey d_atsV))
+ Crypto.Noise: hoRemoteSemiEphemeral :: forall d_atxd. Lens' (HandshakeOpts d_atxd) (Maybe (PublicKey d_atxd))
- Crypto.Noise: hoRemoteStatic :: forall d_atsV. Lens' (HandshakeOpts d_atsV) (Maybe (PublicKey d_atsV))
+ Crypto.Noise: hoRemoteStatic :: forall d_atxd. Lens' (HandshakeOpts d_atxd) (Maybe (PublicKey d_atxd))
- Crypto.Noise: hoRole :: forall d_atsV. Lens' (HandshakeOpts d_atsV) HandshakeRole
+ Crypto.Noise: hoRole :: forall d_atxd. Lens' (HandshakeOpts d_atxd) HandshakeRole
Files
- cacophony.cabal +17/−3
- changelog.md +10/−0
- src/Crypto/Noise.hs +2/−2
- src/Crypto/Noise/Internal/CipherState.hs +6/−4
cacophony.cabal view
@@ -1,5 +1,5 @@ name: cacophony-version: 0.9.0+version: 0.9.1 synopsis: A library implementing the Noise protocol. license: PublicDomain license-file: LICENSE@@ -10,7 +10,7 @@ category: Cryptography build-type: Simple cabal-version: >=1.10-tested-with: GHC == 7.10.3, GHC == 8.0.2+tested-with: GHC == 7.10.3, GHC == 8.0.1 description: This library implements the <https://github.com/trevp/noise/blob/master/noise.md Noise> protocol.@@ -57,7 +57,6 @@ base >=4.8 && <5, bytestring, cryptonite >=0.16,- deepseq, exceptions >=0.8.3, free, lens,@@ -131,6 +130,9 @@ ghc-options: -threaded -O2 -rtsopts -with-rtsopts=-N -Wall -fwarn-tabs + if flag(llvm)+ ghc-options: -fllvm+ executable echo-client default-language: Haskell2010 hs-source-dirs: examples/echo-client@@ -159,6 +161,9 @@ ghc-options: -threaded -O2 -rtsopts -with-rtsopts=-N -Wall -fwarn-tabs + if flag(llvm)+ ghc-options: -fllvm+ -------------------------------------------------------------------------------- -- TESTS @@ -176,6 +181,9 @@ base >=4.8 && <5, hlint + if flag(llvm)+ ghc-options: -fllvm+ test-suite vectors type: exitcode-stdio-1.0 main-is: vectors.hs@@ -207,6 +215,9 @@ VectorFile, Verify + if flag(llvm)+ ghc-options: -fllvm+ -------------------------------------------------------------------------------- -- BENCHMARKS @@ -231,3 +242,6 @@ other-modules: Handshakes Types++ if flag(llvm)+ ghc-options: -fllvm
changelog.md view
@@ -1,3 +1,13 @@+# 0.9.1++* Enabled llvm flag support on executables++* Removed deepseq library dependency++* Disallowed reserved nonce (2^64 - 1)++* Fixed problem with CipherState count not incrementing+ # 0.9.0 * Removed secondary key support (rev 31)
src/Crypto/Noise.hs view
@@ -57,7 +57,7 @@ -- handshake. Please see section 8.4 of the protocol document for details. -- -- To prevent catastrophic key re-use, this function may only be used to--- secure 2^64 post-handshake messages.+-- secure 2^64 - 1 post-handshake messages. writeMessage :: (MonadThrow m, Cipher c, Hash h) => NoiseState c d h -> ScrubbedBytes@@ -76,7 +76,7 @@ -- is complete, if decryption fails a 'DecryptionError' is returned. -- -- To prevent catastrophic key re-use, this function may only be used to--- receive 2^64 post-handshake messages.+-- receive 2^64 - 1 post-handshake messages. readMessage :: (MonadThrow m, Cipher c, Hash h) => NoiseState c d h -> ByteString
src/Crypto/Noise/Internal/CipherState.hs view
@@ -33,8 +33,9 @@ | otherwise = throwM $ MessageLimitReached "encryptAndIncrement" where ct = cipherEncrypt (cs ^. csk) (cs ^. csn) ad plaintext- newState = cs & csn %~ cipherIncNonce- allow = cs ^. csCount < 2 ^ (64 :: Integer)+ newState = cs & csn %~ cipherIncNonce+ & csCount %~ (+1)+ allow = cs ^. csCount < 2 ^ (64 :: Integer) - 1 decryptAndIncrement :: (MonadThrow m, Cipher c) => AssocData@@ -49,5 +50,6 @@ | otherwise = throwM $ MessageLimitReached "decryptAndIncrement" where pt = cipherDecrypt (cs ^. csk) (cs ^. csn) ad ct- newState = maybe cs (const (cs & csn %~ cipherIncNonce)) pt- allow = cs ^. csCount < 2 ^ (64 :: Integer)+ newState = cs & csn %~ cipherIncNonce+ & csCount %~ (+1)+ allow = cs ^. csCount < 2 ^ (64 :: Integer) - 1