packages feed

largeword 1.2.0 → 1.2.1

raw patch · 2 files changed

+7/−20 lines, 2 filesdep ~largeword

Dependency ranges changed: largeword

Files

Tests/Properties.hs view
@@ -18,10 +18,7 @@ import Data.Binary (encode, decode, Binary) import qualified Data.ByteString.Lazy as LZ -import Text.Printf-import Data.Word - instance (Arbitrary a, Arbitrary b) => Arbitrary (LargeKey a b) where    arbitrary = liftM2 LargeKey arbitrary arbitrary @@ -60,7 +57,10 @@ pRepeatedShift' :: Int -> Property pRepeatedShift' n =   (n >= 0) ==> (((iterate (`shift` 8) a)!!n) == shift a (n*8))+  where a :: Word192+        a = 0x0123456789ABCDEFFEDCBA98765432100011223344556677 + pRepeatedShift160 :: Int -> Property pRepeatedShift160 n =   (n >= 0) ==> (((iterate (`shift` 8) (1::Word160))!!n) == shift (1::Word160) (n*8))@@ -73,25 +73,10 @@ u3 = rotate (rotate ((2^255) :: Word256) (1)) (-1) @?=      ((2^255) :: Word256) -a :: Word192-a = 0x0123456789ABCDEFFEDCBA98765432100011223344556677- u4 :: Assertion u4 = shift (0x0123456789ABCDEFFEDCBA98765432100011223344556677 :: Word192) 80 @?=            (0xBA9876543210001122334455667700000000000000000000 :: Word192) ----x :: Word96-x = 0x112233445566778899AABBCC--y :: Word128-y = 0x112233445566778899AABBCCDDEEFF11--z :: Word160-z = 0x112233445566778899AABBCCDDEEFF1122334455- u5 :: Assertion u5 = shift (0x112233445566778899AABBCC :: Word96) 40 @?=            (0x66778899AABBCC0000000000 :: Word96)@@ -105,6 +90,8 @@     , testProperty "largeword quotRem by 16" pQuotRem     , testProperty "largeword rotate left then right" pRotateLeftRight     , testProperty "largeword repeated shift vs single shift" pRepeatedShift+    , testProperty "largeword repeated shift vs single shift" pRepeatedShift'+    , testProperty "largeword repeated shift vs single shift" pRepeatedShift160     , testCase "largeword shift 2^64 by 2^64" u1     , testCase "largeword exponentiation 2^254" u2     , testCase "largeword rotation by 1" u3
largeword.cabal view
@@ -1,5 +1,5 @@ name:           largeword-version:        1.2.0+version:        1.2.1 license:        BSD3 copyright:      Dominic Steinitz <dominic@steinitz.org> author:         Dominic Steinitz <dominic@steinitz.org>@@ -37,7 +37,7 @@                  test-framework-hunit >= 0.2.6 && < 0.4,                  QuickCheck >= 2.4.0.1,                  HUnit >= 1.2.2.3,-                 largeword == 1.1.1+                 largeword == 1.2.1