Hoogle Search

Within LTS Haskell 24.63 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. isPointValid :: Curve -> Point -> Bool

    crypton Crypto.PubKey.ECC.Prim

    check if a point is on specific curve This perform three checks:

    • x is not out of range
    • y is not out of range
    • the equation y^2 = x^3 + a*x + b (mod p) holds

  2. scalarIsValid :: EllipticCurveECDSA curve => proxy curve -> Scalar curve -> Bool

    crypton Crypto.PubKey.ECDSA

    Is a scalar in the accepted range for ECDSA

  3. InvalidParameters :: Error

    crypton Crypto.PubKey.RSA

    some parameters lead to breaking assumptions.

  4. InvalidParameters :: Error

    crypton Crypto.PubKey.RSA.Types

    some parameters lead to breaking assumptions.

  5. InvalidParameters :: Error

    crypton Crypto.PubKey.Rabin.Types

    some parameters lead to breaking assumptions

  6. package genvalidity

    Testing utilities for the validity library Note: There are companion instance packages for this library:

  7. module Data.GenValidity

    GenValid exists to make tests involving Validity types easier and speed up the generation of data for them. To implement tests for this datatype, we would have to be able to generate both primes. We could do this with a generator like this one:

    (Prime <$> 'arbitrary') `suchThat` isValid
    
    However, this is tedious and inefficient, as well as quite naive (because arbitrary tends to use very naive generators). The GenValid type class allows you to specify how to (efficiently) generate valid data of the given type to allow for easier and quicker testing. The default implementation of GenValid already gives you a generator and shrinking function for free:
    instance GenValid Prime
    
    For example, to generate primes, we don't have to consider even numbers other than 2. A more efficient implementation could then look as follows:
    instance GenValid Prime where
    genValid = Prime <$>
    (oneof
    [ pure 2
    , ((\y -> 2 * abs y + 1) <$> arbitrary) `suchThat` isPrime)
    ])
    
    Typical examples of tests involving validity could look as follows:
    it "succeeds when given valid input" $ do
    forAllValid $ \input ->
    myFunction input `shouldSatisfy` isRight
    
    it "produces valid output when it succeeds" $ do
    forAllValid $ \input ->
    case myFunction input of
    Nothing -> return () -- Can happen
    Just output -> output `shouldSatisfy` isValid
    
    Definitely also look at the companion packages for more info on how to use this package.

  8. class GGenValid (f :: Type -> Type)

    genvalidity Data.GenValidity

    No documentation available.

  9. class GValidRecursivelyShrink (f :: Type -> Type)

    genvalidity Data.GenValidity

    No documentation available.

  10. class GValidSubterms (f :: Type -> Type) a

    genvalidity Data.GenValidity

    No documentation available.

Page 425 of many | Previous | Next