Copyright | (c) Leo D 2023 |
---|---|
License | BSD-3-Clause |
Maintainer | leo@apotheca.io |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- botan_privkey_create_elgamal :: Ptr BotanPrivKey -> BotanRNG -> CSize -> CSize -> IO CInt
- botan_pubkey_load_elgamal :: Ptr BotanPubKey -> BotanMP -> BotanMP -> BotanMP -> IO CInt
- botan_privkey_load_elgamal :: Ptr BotanPrivKey -> BotanMP -> BotanMP -> BotanMP -> IO CInt
Documentation
botan_privkey_create_elgamal Source #
:: Ptr BotanPrivKey | key: handler to the resulting key |
-> BotanRNG | rng: initialized PRNG |
-> CSize | pbits: length of the key in bits. Must be at least 1024 |
-> CSize | qbits: order of the subgroup. Must be at least 160 |
-> IO CInt |
|
Generates ElGamal key pair. Caller has a control over key length
and order of a subgroup q
. Function is able to use two types of
primes:
- if pbits-1 == qbits then safe primes are used for key generation
- otherwise generation uses group of prime order
botan_pubkey_load_elgamal Source #
:: Ptr BotanPubKey | key: variable populated with key material |
-> BotanMP | p: prime order of a Z_p group |
-> BotanMP | g: group generator |
-> BotanMP | y: private key |
-> IO CInt | 0 on success, a negative value on failure |
Loads ElGamal private key
botan_privkey_load_elgamal Source #
:: Ptr BotanPrivKey | key: variable populated with key material |
-> BotanMP | p: prime order of a Z_p group |
-> BotanMP | g: group generator |
-> BotanMP | x: public key |
-> IO CInt | 0 on success, a negative value on failure |
Loads ElGamal public key