RSA 2.0 → 2.0.0
raw patch · 4 files changed
+53/−6 lines, 4 filesdep ~DRBGdep ~QuickCheckdep ~SHAnew-component:exe:rsa_test
Dependency ranges changed: DRBG, QuickCheck, SHA, base, pureMD5
Files
- RSA.cabal +35/−3
- Test.hs +3/−1
- src/Codec/Crypto/RSA/Exceptions.hs +5/−1
- src/Codec/Crypto/RSA/Pure.hs +10/−1
RSA.cabal view
@@ -1,6 +1,6 @@ name: RSA category: Cryptography, Codec-version: 2.0+version: 2.0.0 license: BSD3 license-file: LICENSE author: Adam Wick <awick@galois.com>@@ -21,6 +21,10 @@ Description: Whether or not to use base 3 (default: no) Default: False +Flag BuildTestExecutable+ Description: Whether to build the test code as a separate exeutable,+ instead of just utilizing the cabal test framework.+ Library hs-source-dirs: src build-depends: binary > 0.0 && < 10000,@@ -45,6 +49,34 @@ GHC-Options: -Wall -fno-warn-orphans extensions: BangPatterns, DeriveDataTypeable +executable rsa_test+ Main-Is: Test.hs+ if flag(OldBase)+ build-depends: base >= 3 && < 4,+ pureMD5 < 1.1,+ SHA < 1.4.1+ else+ build-depends: base >= 4 && < 7,+ pureMD5 > 0 && < 10000,+ SHA > 0 && < 10000++ build-depends: binary > 0.0 && < 10000,+ bytestring > 0.8 && < 10000,+ crypto-api >= 0.10 && < 10000,+ crypto-pubkey-types >= 0.2 && < 10000,+ DRBG >= 0.5.2 && < 10000,+ QuickCheck >= 2.5 && < 3,+ RSA >= 2 && < 10000,+ tagged >= 0.2 && < 10000,+ test-framework >= 0.8.0.3 && < 10000,+ test-framework-quickcheck2 >= 0.3.0.2 && < 10000+ if flag(BuildTestExecutable)+ buildable: True+ else+ buildable: False+ GHC-Options: -Wall -fno-warn-orphans + extensions: ScopedTypeVariables+ Test-Suite test-RSA type: exitcode-stdio-1.0 Main-Is: Test.hs@@ -62,8 +94,8 @@ bytestring > 0.8 && < 10000, crypto-api >= 0.10 && < 10000, crypto-pubkey-types >= 0.2 && < 10000,- DRBG > 0.5 && < 10000,- QuickCheck >= 2.4 && < 3,+ DRBG >= 0.5.2 && < 10000,+ QuickCheck >= 2.5 && < 3, RSA >= 2 && < 10000, tagged >= 0.2 && < 10000, test-framework >= 0.8.0.3 && < 10000,
Test.hs view
@@ -65,13 +65,15 @@ show (HashInfo ident _) | ident == algorithmIdent hashMD5 = "<MD5>" | ident == algorithmIdent hashSHA1 = "<SHA1>"+ | ident == algorithmIdent hashSHA224 = "<SHA224>" | ident == algorithmIdent hashSHA256 = "<SHA256>" | ident == algorithmIdent hashSHA384 = "<SHA384>" | ident == algorithmIdent hashSHA512 = "<SHA512>" | otherwise = "<unknownHASH>" instance Arbitrary HashInfo where- arbitrary = elements [hashMD5, hashSHA1, hashSHA256, hashSHA384, hashSHA512]+ arbitrary = elements [hashMD5, hashSHA1, hashSHA224,+ hashSHA256, hashSHA384, hashSHA512] newtype LargePrime = LP Integer deriving (Show)
src/Codec/Crypto/RSA/Exceptions.hs view
@@ -27,7 +27,8 @@ , rsassa_pkcs1_v1_5_sign , rsassa_pkcs1_v1_5_verify -- * Hashing algorithm declarations for use in RSA functions- , hashMD5, hashSHA1, hashSHA256, hashSHA384, hashSHA512+ , hashMD5, hashSHA1+ , hashSHA224, hashSHA256, hashSHA384, hashSHA512 -- * Other mathematical functions that are handy for implementing -- other RSA primitives. , largeRandomPrime@@ -363,6 +364,9 @@ hashSHA1 :: HashInfo hashSHA1 = Pure.hashSHA1++hashSHA224 :: HashInfo+hashSHA224 = Pure.hashSHA224 hashSHA256 :: HashInfo hashSHA256 = Pure.hashSHA256
src/Codec/Crypto/RSA/Pure.hs view
@@ -29,7 +29,8 @@ , rsassa_pkcs1_v1_5_sign , rsassa_pkcs1_v1_5_verify -- * Hashing algorithm declarations for use in RSA functions- , hashMD5, hashSHA1, hashSHA256, hashSHA384, hashSHA512+ , hashMD5, hashSHA1+ , hashSHA224, hashSHA256, hashSHA384, hashSHA512 -- * Other mathematical functions that are handy for implementing -- other RSA primitives. , largeRandomPrime@@ -753,6 +754,14 @@ algorithmIdent = BS.pack [0x30,0x21,0x30,0x09,0x06,0x05,0x2b,0x0e,0x03, 0x02,0x1a,0x05,0x00,0x04,0x14] , hashFunction = bytestringDigest . sha1+ }++hashSHA224 :: HashInfo+hashSHA224 = HashInfo {+ algorithmIdent = BS.pack [0x30,0x2d,0x30,0x0d,0x06,0x09,0x60,0x86,0x48,+ 0x01,0x65,0x03,0x04,0x02,0x04,0x05,0x00,0x04,+ 0x1c]+ , hashFunction = bytestringDigest . sha224 } hashSHA256 :: HashInfo