33#include <openssl/bn.h>
47 px_debug(
"mpi_to_bn: bignum conversion failed: mpi=%d, bn=%d",
67 px_debug(
"bn_to_mpi: bignum conversion failed: bn=%d, mpi=%d",
97 return (
p_bits / 8 + 200) * 3 / 2;
116 if (!m || !p || !g || !
y || !k || !
yk || !
c1 || !
c2 || !tmp)
177 if (!
c1 || !
c2 || !p || !
x || !
c1x || !
div || !m || !tmp)
224 if (!m || !
e || !n || !
c || !tmp)
260 if (!m || !d || !n || !
c || !tmp)
void err(int eval, const char *fmt,...)
int pgp_rsa_decrypt(PGP_PubKey *pk, PGP_MPI *_c, PGP_MPI **m_p)
int pgp_elgamal_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c1_p, PGP_MPI **c2_p)
int pgp_elgamal_decrypt(PGP_PubKey *pk, PGP_MPI *_c1, PGP_MPI *_c2, PGP_MPI **msg_p)
static BIGNUM * mpi_to_bn(PGP_MPI *n)
static int decide_k_bits(int p_bits)
int pgp_rsa_encrypt(PGP_PubKey *pk, PGP_MPI *_m, PGP_MPI **c_p)
static PGP_MPI * bn_to_mpi(BIGNUM *bn)
int pgp_mpi_alloc(int bits, PGP_MPI **mpi)
int pgp_mpi_free(PGP_MPI *mpi)
void px_debug(const char *fmt,...)
#define PXE_PGP_MATH_FAILED