File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
hnix-store-core/src/System/Nix/Internal Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 22Description : Nix-relevant interfaces to NaCl signatures.
33-}
44{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5+ {-# LANGUAGE CPP #-}
56
67module System.Nix.Internal.Signature where
78
@@ -11,16 +12,25 @@ import qualified Data.ByteString as Bytes
1112import Data.Coerce ( coerce )
1213import Crypto.Saltine.Core.Sign ( PublicKey )
1314import Crypto.Saltine.Class ( IsEncoding (.. ) )
14- import qualified Crypto.Saltine.Internal.ByteSizes as NaClSizes
1515
16+ -- 2021-05-30: NOTE: Please, clean-up these overloads in ~2022
17+ #if MIN_VERSION_saltine(0,2,0)
18+ import qualified Crypto.Saltine.Internal.Sign as NaClSizes
19+ #else
20+ import qualified Crypto.Saltine.Internal.ByteSizes as NaClSizes
21+ #endif
1622
1723-- | A NaCl signature.
1824newtype Signature = Signature ByteString
1925 deriving (Eq , Ord )
2026
2127instance IsEncoding Signature where
2228 decode s
29+ #if MIN_VERSION_saltine(0,2,0)
30+ | Bytes. length s == NaClSizes. sign_bytes = Just $ Signature s
31+ #else
2332 | Bytes. length s == NaClSizes. sign = Just $ Signature s
33+ #endif
2434 | otherwise = Nothing
2535 encode = coerce
2636
You can’t perform that action at this time.
0 commit comments