packages feed

saltine 0.2.0.1 → 0.2.1.0

raw patch · 14 files changed

+28/−18 lines, 14 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Crypto.Saltine.Internal.Box: instance GHC.Show.Show Crypto.Saltine.Internal.Box.Keypair
+ Crypto.Saltine.Internal.Sign: instance GHC.Show.Show Crypto.Saltine.Internal.Sign.Keypair

Files

CHANGELOG.md view
@@ -7,6 +7,10 @@ ### Added ### Changed +## [0.2.1.0] - 2023-02-17+### Changed+- Fix Show instances formatting, and add instances for Keypairs, thanks [@NicolasT](https://github.com/NicolasT)+ ## [0.2.0.1] - 2022-04-30 ### Changed - Relax version bounds on text and bytestring, thanks [@ysangkok](https://github.com/ysangkok)
README.md view
@@ -1,4 +1,4 @@-# Saltine 0.2.0.1 [![Hackage version](https://img.shields.io/hackage/v/saltine.svg?colorB=4FB900)](https://hackage.haskell.org/package/saltine)+# Saltine 0.2.1.0 [![Hackage version](https://img.shields.io/hackage/v/saltine.svg?colorB=4FB900)](https://hackage.haskell.org/package/saltine)  A Haskell binding for @jedisct1's portable binding for djb's NaCl. **This is an early release.** Please try it out, but don't just
saltine.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.0  name:                saltine-version:             0.2.0.1+version:             0.2.1.0 synopsis:            Cryptography that's easy to digest (NaCl/libsodium bindings). description: @@ -32,7 +32,7 @@ copyright:           Copyright (c) Joseph Abrahamson 2013 category:            Cryptography build-type:          Simple-tested-with:         GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.4, GHC==8.10.7, GHC==9.0.2, GHC==9.2.2+tested-with:         GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.4, GHC==8.10.7, GHC==9.0.2, GHC==9.2.6, GHC==9.4.4  source-repository head   type: git
src/Crypto/Saltine/Internal/AEAD/AES256GCM.hs view
@@ -41,7 +41,7 @@ instance Eq Key where     Key a == Key b = U.compare a b instance Show Key where-    show k = "AEAD.AES256GCM.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "AEAD.AES256GCM.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding Key where   decode v = if S.length v == aead_aes256gcm_keybytes
src/Crypto/Saltine/Internal/AEAD/ChaCha20Poly1305.hs view
@@ -41,7 +41,7 @@ instance Eq Key where     Key a == Key b = U.compare a b instance Show Key where-    show k = "AEAD.ChaCha20Poly1305.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "AEAD.ChaCha20Poly1305.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding Key where   decode v = if S.length v == aead_chacha20poly1305_keybytes
src/Crypto/Saltine/Internal/AEAD/ChaCha20Poly1305IETF.hs view
@@ -41,7 +41,7 @@ instance Eq Key where     Key a == Key b = U.compare a b instance Show Key where-    show k = "AEAD.ChaCha20Poly1305IETF.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "AEAD.ChaCha20Poly1305IETF.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding Key where   decode v = if S.length v == aead_chacha20poly1305_ietf_keybytes
src/Crypto/Saltine/Internal/AEAD/XChaCha20Poly1305.hs view
@@ -40,7 +40,7 @@ instance Eq Key where     Key a == Key b = U.compare a b instance Show Key where-    show k = "AEAD.XChaCha20Poly1305.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "AEAD.XChaCha20Poly1305.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding Key where   decode v = if S.length v == aead_xchacha20poly1305_ietf_keybytes
src/Crypto/Saltine/Internal/Auth.hs view
@@ -38,7 +38,7 @@ instance Eq Key where     Key a == Key b = U.compare a b instance Show Key where-    show k = "Auth.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Auth.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding Key where   decode v = if S.length v == auth_keybytes
src/Crypto/Saltine/Internal/Box.hs view
@@ -52,7 +52,7 @@ instance Eq SecretKey where     SK a == SK b = U.compare a b instance Show SecretKey where-    show k = "Box.SecretKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Box.SecretKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding SecretKey where   decode v = if S.length v == box_secretkeybytes@@ -67,7 +67,7 @@ instance Eq PublicKey where     PK a == PK b = U.compare a b instance Show PublicKey where-    show k = "Box.PublicKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Box.PublicKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding PublicKey where   decode v = if S.length v == box_publickeybytes@@ -87,6 +87,9 @@     kp1 == kp2 = U.compare (encode $ secretKey kp1) (encode $ secretKey kp2)             !&&! U.compare (encode $ publicKey kp1) (encode $ publicKey kp2) +instance Show Keypair where+    show k = "Box.Keypair {secretKey = " <> show (secretKey k) <> ", publicKey = " <> show (publicKey k) <> "}"+ instance Hashable Keypair instance NFData   Keypair @@ -95,7 +98,7 @@ instance Eq CombinedKey where     CK a == CK b = U.compare a b instance Show CombinedKey where-    show k = "Box.CombinedKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Box.CombinedKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding CombinedKey where   decode v = if S.length v == box_beforenmbytes
src/Crypto/Saltine/Internal/Hash.hs view
@@ -43,7 +43,7 @@ instance Eq ShorthashKey where     ShK a == ShK b = U.compare a b instance Show ShorthashKey where-    show k = "Hash.ShorthashKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Hash.ShorthashKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  -- | Used for our `Show` instances nullShKey :: ShorthashKey@@ -73,7 +73,7 @@ instance Eq GenerichashKey where     GhK a == GhK b = U.compare a b instance Show GenerichashKey where-    show k = "Hash.GenerichashKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Hash.GenerichashKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding GenerichashKey where   decode v = if S.length v <= generichash_keybytes_max
src/Crypto/Saltine/Internal/OneTimeAuth.hs view
@@ -38,7 +38,7 @@ instance Eq Key where     Key a == Key b = U.compare a b instance Show Key where-    show k = "OneTimeAuth.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "OneTimeAuth.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding Key where   decode v = if S.length v == onetimeauth_keybytes
src/Crypto/Saltine/Internal/SecretBox.hs view
@@ -45,7 +45,7 @@ instance Eq Key where     Key a == Key b = U.compare a b instance Show Key where-    show k = "SecretBox.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "SecretBox.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding Key where   decode v = if S.length v == secretbox_keybytes
src/Crypto/Saltine/Internal/Sign.hs view
@@ -44,7 +44,7 @@ instance Eq SecretKey where     SK a == SK b = U.compare a b instance Show SecretKey where-    show k = "Sign.SecretKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Sign.SecretKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding SecretKey where   decode v = if S.length v == sign_secretkeybytes@@ -59,7 +59,7 @@ instance Eq PublicKey where     PK a == PK b = U.compare a b instance Show PublicKey where-    show k = "Sign.PublicKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Sign.PublicKey {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding PublicKey where   decode v = if S.length v == sign_publickeybytes@@ -78,6 +78,9 @@ instance Eq Keypair where     kp1 == kp2 = U.compare (encode $ secretKey kp1) (encode $ secretKey kp2)             !&&! U.compare (encode $ publicKey kp1) (encode $ publicKey kp2)++instance Show Keypair where+    show k = "Sign.Keypair {secretKey = " <> show (secretKey k) <> ", publicKey = " <> show (publicKey k) <> "}"  instance Hashable Keypair instance NFData   Keypair
src/Crypto/Saltine/Internal/Stream.hs view
@@ -37,7 +37,7 @@ instance Eq Key where     Key a == Key b = U.compare a b instance Show Key where-    show k = "Stream.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "}\""+    show k = "Stream.Key {hashesTo = \"" <> (bin2hex . shorthash nullShKey $ encode k) <> "\"}"  instance IsEncoding Key where   decode v = if S.length v == stream_keybytes