pairing-0.4.1: Bilinear pairings

Safe HaskellNone
LanguageHaskell2010

Pairing.Modular

Synopsis

Documentation

withMod :: Integer -> (forall m. KnownNat m => Proxy m -> r) -> r Source #

withModM :: Integer -> (forall n. KnownNat n => Proxy n -> m r) -> m r Source #

withQ :: (forall m. KnownNat m => Proxy m -> r) -> r Source #

withQM :: (forall n. KnownNat n => Proxy n -> m r) -> m r Source #

withR :: (forall m. KnownNat m => Proxy m -> r) -> r Source #

withRM :: (forall n. KnownNat n => Proxy n -> m r) -> m r Source #

newMod :: forall m. KnownNat m => Integer -> Proxy m -> Mod m Source #

modUnOp :: forall m. KnownNat m => Integer -> (Mod m -> Mod m) -> Proxy m -> Integer Source #

modBinOp :: forall m. KnownNat m => Integer -> Integer -> (Mod m -> Mod m -> Mod m) -> Proxy m -> Integer Source #

modUnOpM :: forall m a. (KnownNat m, Monad a) => Integer -> (Mod m -> a (Mod m)) -> Proxy m -> a Integer Source #

modUnOpMTup :: forall m a. (KnownNat m, Monad a) => Integer -> (Mod m -> a (Mod m, Mod m)) -> Proxy m -> a (Integer, Integer) Source #

isSquare :: forall m. KnownNat m => Proxy m -> Mod m -> Bool Source #

sqrtOf :: forall m. KnownNat m => Mod m -> Maybe (Mod m) Source #

Picks the postive square root only |

bothSqrtOf :: forall m. KnownNat m => Mod m -> Maybe (Mod m, Mod m) Source #

randomMod :: forall n m. (MonadRandom m, KnownNat n) => Proxy n -> m (Mod n) Source #

fromBytes :: forall n. KnownNat n => ByteOrder -> ByteString -> Proxy n -> Mod n Source #