crypto-pubkey-types 0.3.2 → 0.4.0
raw patch · 4 files changed
+47/−22 lines, 4 filesdep ~asn1-typesPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: asn1-types
API changes (from Hackage documentation)
- Crypto.Types.PubKey.DSA: type Signature = (Integer, Integer)
+ Crypto.Types.PubKey.DH: instance ASN1Object Params
+ Crypto.Types.PubKey.DSA: Signature :: Integer -> Integer -> Signature
+ Crypto.Types.PubKey.DSA: data Signature
+ Crypto.Types.PubKey.DSA: instance ASN1Object Signature
+ Crypto.Types.PubKey.DSA: instance Data Signature
+ Crypto.Types.PubKey.DSA: instance Eq Signature
+ Crypto.Types.PubKey.DSA: instance Read Signature
+ Crypto.Types.PubKey.DSA: instance Show Signature
+ Crypto.Types.PubKey.DSA: instance Typeable Signature
+ Crypto.Types.PubKey.DSA: sign_r :: Signature -> Integer
+ Crypto.Types.PubKey.DSA: sign_s :: Signature -> Integer
Files
- Crypto/Types/PubKey/DH.hs +12/−0
- Crypto/Types/PubKey/DSA.hs +15/−2
- Crypto/Types/PubKey/ECC.hs +18/−18
- crypto-pubkey-types.cabal +2/−2
Crypto/Types/PubKey/DH.hs view
@@ -15,12 +15,24 @@ ) where import Data.Data+import Data.ASN1.Types -- | Represent Diffie Hellman parameters namely P (prime), and G (generator). data Params = Params { params_p :: Integer , params_g :: Integer } deriving (Show,Read,Eq,Data,Typeable)++instance ASN1Object Params where+ toASN1 params = \xs -> Start Sequence+ : IntVal (params_p params)+ : IntVal (params_g params)+ : End Sequence+ : xs ++ fromASN1 (Start Sequence:IntVal p:IntVal g:End Sequence:xs) =+ Right (Params { params_p = p, params_g = g }, xs)+ fromASN1 _ = Left "fromASN1: DH.Params: unexpected format" -- | Represent Diffie Hellman public number Y. newtype PublicNumber = PublicNumber Integer
Crypto/Types/PubKey/DSA.hs view
@@ -8,7 +8,7 @@ -- module Crypto.Types.PubKey.DSA ( Params(..)- , Signature+ , Signature(..) , PublicNumber , PublicKey(..) , PrivateNumber@@ -46,7 +46,20 @@ fromASN1 _ = Left "fromASN1: DSA.Params: unexpected format" -- | Represent a DSA signature namely R and S.-type Signature = (Integer,Integer)+data Signature = Signature+ { sign_r :: Integer -- ^ DSA r+ , sign_s :: Integer -- ^ DSA s+ } deriving (Show,Read,Eq,Data,Typeable)++instance ASN1Object Signature where+ toASN1 sign = \xs -> Start Sequence+ : IntVal (sign_r sign)+ : IntVal (sign_s sign)+ : End Sequence+ : xs+ fromASN1 (Start Sequence:IntVal r:IntVal s:End Sequence:xs) =+ Right (Signature { sign_r = r, sign_s = s }, xs)+ fromASN1 _ = Left "fromASN1: DSA.Signature: unexpected format" -- | Represent a DSA public key. data PublicKey = PublicKey
Crypto/Types/PubKey/ECC.hs view
@@ -79,24 +79,24 @@ | SEC_p256r1 | SEC_p384r1 | SEC_p521r1 - | SEC_t113r1- | SEC_t113r2- | SEC_t131r1- | SEC_t131r2- | SEC_t163k1- | SEC_t163r1- | SEC_t163r2- | SEC_t193r1- | SEC_t193r2- | SEC_t233k1- | SEC_t233r1- | SEC_t239k1- | SEC_t283k1- | SEC_t283r1- | SEC_t409k1- | SEC_t409r1- | SEC_t571k1- | SEC_t571r1+ | SEC_t113r1+ | SEC_t113r2+ | SEC_t131r1+ | SEC_t131r2+ | SEC_t163k1+ | SEC_t163r1+ | SEC_t163r2+ | SEC_t193r1+ | SEC_t193r2+ | SEC_t233k1+ | SEC_t233r1+ | SEC_t239k1+ | SEC_t283k1+ | SEC_t283r1+ | SEC_t409k1+ | SEC_t409r1+ | SEC_t571k1+ | SEC_t571r1 deriving (Show,Eq,Ord) -- | get the curve definition associated with a recommended known curve name.
crypto-pubkey-types.cabal view
@@ -1,5 +1,5 @@ Name: crypto-pubkey-types-Version: 0.3.2+Version: 0.4.0 Description: Generic cryptography public keys algorithm types License: BSD3 License-file: LICENSE@@ -19,7 +19,7 @@ Crypto.Types.PubKey.ECC Crypto.Types.PubKey.ECDSA Build-depends: base >= 4 && < 5- , asn1-types >= 0.1 && < 0.2+ , asn1-types >= 0.1 && < 0.3 source-repository head type: git