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 2
2
Description : Nix-relevant interfaces to NaCl signatures.
3
3
-}
4
4
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
5
+ {-# LANGUAGE CPP #-}
5
6
6
7
module System.Nix.Internal.Signature where
7
8
@@ -11,16 +12,25 @@ import qualified Data.ByteString as Bytes
11
12
import Data.Coerce ( coerce )
12
13
import Crypto.Saltine.Core.Sign ( PublicKey )
13
14
import Crypto.Saltine.Class ( IsEncoding (.. ) )
14
- import qualified Crypto.Saltine.Internal.ByteSizes as NaClSizes
15
15
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
16
22
17
23
-- | A NaCl signature.
18
24
newtype Signature = Signature ByteString
19
25
deriving (Eq , Ord )
20
26
21
27
instance IsEncoding Signature where
22
28
decode s
29
+ #if MIN_VERSION_saltine(0,2,0)
30
+ | Bytes. length s == NaClSizes. sign_bytes = Just $ Signature s
31
+ #else
23
32
| Bytes. length s == NaClSizes. sign = Just $ Signature s
33
+ #endif
24
34
| otherwise = Nothing
25
35
encode = coerce
26
36
You can’t perform that action at this time.
0 commit comments