cryptonite-0.27: Cryptography Primitives sink
License BSD-style
Maintainer Carlos Rodriguez-Vega <crodveg@yahoo.es>
Stability experimental
Portability unknown
Safe Haskell None
Language Haskell2010

Crypto.PubKey.Rabin.Modified

Description

Modified-Rabin public-key digital signature algorithm. See algorithm 11.30 in "Handbook of Applied Cryptography" by Alfred J. Menezes et al.

Synopsis

Documentation

data PublicKey Source #

Represent a Modified-Rabin public key.

Constructors

PublicKey

Fields

Instances

Instances details
Eq PublicKey Source #
Instance details

Defined in Crypto.PubKey.Rabin.Modified

Data PublicKey Source #
Instance details

Defined in Crypto.PubKey.Rabin.Modified

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> PublicKey -> c PublicKey Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c PublicKey Source #

toConstr :: PublicKey -> Constr Source #

dataTypeOf :: PublicKey -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c PublicKey ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c PublicKey ) Source #

gmapT :: ( forall b. Data b => b -> b) -> PublicKey -> PublicKey Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> PublicKey -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> PublicKey -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> PublicKey -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> PublicKey -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> PublicKey -> m PublicKey Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> PublicKey -> m PublicKey Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> PublicKey -> m PublicKey Source #

Read PublicKey Source #
Instance details

Defined in Crypto.PubKey.Rabin.Modified

Show PublicKey Source #
Instance details

Defined in Crypto.PubKey.Rabin.Modified

data PrivateKey Source #

Represent a Modified-Rabin private key.

Instances

Instances details
Eq PrivateKey Source #
Instance details

Defined in Crypto.PubKey.Rabin.Modified

Data PrivateKey Source #
Instance details

Defined in Crypto.PubKey.Rabin.Modified

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> PrivateKey -> c PrivateKey Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c PrivateKey Source #

toConstr :: PrivateKey -> Constr Source #

dataTypeOf :: PrivateKey -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c PrivateKey ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c PrivateKey ) Source #

gmapT :: ( forall b. Data b => b -> b) -> PrivateKey -> PrivateKey Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> PrivateKey -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> PrivateKey -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> PrivateKey -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> PrivateKey -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> PrivateKey -> m PrivateKey Source #

Read PrivateKey Source #
Instance details

Defined in Crypto.PubKey.Rabin.Modified

Show PrivateKey Source #
Instance details

Defined in Crypto.PubKey.Rabin.Modified

generate :: MonadRandom m => Int -> m ( PublicKey , PrivateKey ) Source #

Generate a pair of (private, public) key of size in bytes. Prime p is congruent 3 mod 8 and prime q is congruent 7 mod 8.

sign Source #

Arguments

:: HashAlgorithm hash
=> PrivateKey

private key

-> hash

hash function

-> ByteString

message to sign

-> Either Error Integer

Sign message using hash algorithm and private key.

verify Source #

Arguments

:: HashAlgorithm hash
=> PublicKey

public key

-> hash

hash function

-> ByteString

message

-> Integer

signature

-> Bool

Verify signature using hash algorithm and public key.