mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-11-24 05:33:19 +03:00
core: clean saltine CPP overloads
One year late hah. Thanks Anton!
This commit is contained in:
parent
541abd1e20
commit
631b26e436
@ -1,4 +1,3 @@
|
||||
{-# LANGUAGE CPP #-}
|
||||
{-|
|
||||
Description : Nix-relevant interfaces to NaCl signatures.
|
||||
-}
|
||||
@ -16,12 +15,7 @@ import GHC.Generics (Generic)
|
||||
import qualified Data.ByteString
|
||||
import qualified Data.Coerce
|
||||
|
||||
-- 2021-05-30: NOTE: Please, clean-up these overloads in ~2022
|
||||
#if MIN_VERSION_saltine(0,2,0)
|
||||
import qualified Crypto.Saltine.Internal.Sign as NaClSizes
|
||||
#else
|
||||
import qualified Crypto.Saltine.Internal.ByteSizes as NaClSizes
|
||||
#endif
|
||||
|
||||
-- | A NaCl signature.
|
||||
newtype Signature = Signature ByteString
|
||||
@ -29,11 +23,7 @@ newtype Signature = Signature ByteString
|
||||
|
||||
instance IsEncoding Signature where
|
||||
decode s
|
||||
#if MIN_VERSION_saltine(0,2,0)
|
||||
| Data.ByteString.length s == NaClSizes.sign_bytes = Just $ Signature s
|
||||
#else
|
||||
| Data.ByteString.length s == NaClSizes.sign = Just $ Signature s
|
||||
#endif
|
||||
| otherwise = Nothing
|
||||
encode = Data.Coerce.coerce
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user