#include <stdio.h>
#include <string.h>

#include <bn.h>
#include <dsa.h>
#include <dh.h>

BIGNUM *pgp2BN5(unsigned char **buf);
extern FILE *kring;
extern unsigned long long nkidul;
extern unsigned char xbp[3];
void donewkeyid(unsigned char *, int);
FILE *setkeyring5(char *file);
void setkeyring5_fp(FILE * newkr);
int getkey5(DH **, DSA **, unsigned char *, unsigned long long *);
void keyout5(FILE * sec, FILE * pub, void *key, int primary, int alg,
             unsigned char *hashpass, char *userid);
int getcfbkey(unsigned char **bp, unsigned char *hashpass, void **);
int putcfbkey(unsigned char *, const unsigned char *, unsigned char, void **);
void keyhash(int, int, int, int, unsigned char *, unsigned char *);
int sigmak5(void *, FILE *, FILE *, unsigned long long,
            unsigned int, unsigned int, unsigned int, unsigned char *);
int sigchk5(unsigned char *sigp, void *hctx);
int pkeenc5(unsigned long long, unsigned char *, unsigned char *,
            unsigned int, unsigned int);
int pkedec5(unsigned char *, unsigned char *);
void cnvenc5(FILE * inf, FILE * outf, void *);
int cnvdec5(FILE * inf, FILE * outf, void *);
int dearmor(FILE *, FILE *);
int armor(FILE *, FILE *, char *, char *);
void *hashinit(int ha);
void hashupdate(void *ctx, unsigned char *, unsigned int);
void hashfinal(unsigned char *buf, void *ctx);
int cnvkeysiz(const int cipher);
void *cfbinit(unsigned char *key, const unsigned char *iv0, int cip, int enc);
void docfb(unsigned char *buf, int len, void *);
void cfbreset(const unsigned char *, void *);
int decrypt5(FILE * inf, FILE * outf, unsigned char *keybuf);
int dlitck5(FILE * inf, FILE * outf, int *);
int pgpcomp5(FILE * inf, FILE * outf);
int pgpdcom5(FILE * inf, FILE * outf);
unsigned char *gazinta(FILE * fp, unsigned char ctb, int *gazouta);

extern unsigned int hashlen[];
extern unsigned int hashDERlen[];
extern unsigned char hashDER[][64];

#ifndef NO_RSA
#include <rsa.h>
void keyout2(FILE * sec, FILE * pub, unsigned char *hp, char *uid, RSA *);
#endif
