module Botan.Low.PubKey.DSA where
import qualified Data.ByteString as ByteString
import Botan.Bindings.PubKey
import Botan.Bindings.PubKey.DSA
import Botan.Low.Error
import Botan.Low.Make
import Botan.Low.MPI
import Botan.Low.Prelude
import Botan.Low.PubKey
import Botan.Low.RNG
privKeyCreateDSA
:: RNG
-> Int
-> Int
-> IO PrivKey
privKeyCreateDSA :: RNG -> Int -> Int -> IO PrivKey
privKeyCreateDSA RNG
rng Int
pbits Int
qbits = RNG -> (BotanRNG -> IO PrivKey) -> IO PrivKey
forall a. RNG -> (BotanRNG -> IO a) -> IO a
withRNG RNG
rng ((BotanRNG -> IO PrivKey) -> IO PrivKey)
-> (BotanRNG -> IO PrivKey) -> IO PrivKey
forall a b. (a -> b) -> a -> b
$ \ BotanRNG
botanRNG -> do
(Ptr BotanPrivKey -> IO CInt) -> IO PrivKey
createPrivKey ((Ptr BotanPrivKey -> IO CInt) -> IO PrivKey)
-> (Ptr BotanPrivKey -> IO CInt) -> IO PrivKey
forall a b. (a -> b) -> a -> b
$ \ Ptr BotanPrivKey
out -> Ptr BotanPrivKey -> BotanRNG -> CSize -> CSize -> IO CInt
botan_privkey_create_dsa
Ptr BotanPrivKey
out
BotanRNG
botanRNG
(Int -> CSize
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
pbits)
(Int -> CSize
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
qbits)
privKeyLoadDSA
:: MP
-> MP
-> MP
-> MP
-> IO PrivKey
privKeyLoadDSA :: MP -> MP -> MP -> MP -> IO PrivKey
privKeyLoadDSA = (Ptr BotanPrivKey
-> BotanMP -> BotanMP -> BotanMP -> BotanMP -> IO CInt)
-> MP -> MP -> MP -> MP -> IO PrivKey
mkPrivKeyLoad4 Ptr BotanPrivKey
-> BotanMP -> BotanMP -> BotanMP -> BotanMP -> IO CInt
botan_privkey_load_dsa
pubKeyLoadDSA
:: MP
-> MP
-> MP
-> MP
-> IO PubKey
pubKeyLoadDSA :: MP -> MP -> MP -> MP -> IO PubKey
pubKeyLoadDSA = (Ptr BotanPubKey
-> BotanMP -> BotanMP -> BotanMP -> BotanMP -> IO CInt)
-> MP -> MP -> MP -> MP -> IO PubKey
mkPubKeyLoad4 Ptr BotanPubKey
-> BotanMP -> BotanMP -> BotanMP -> BotanMP -> IO CInt
botan_pubkey_load_dsa