#include <catacomb/gcipher.h>
#include <catacomb/ghash.h>
#include <catacomb/gmac.h>
#include <catacomb/gcipher.h>
#include <catacomb/ghash.h>
#include <catacomb/gmac.h>
#include <catacomb/mpint.h>
#include <catacomb/mpmul.h>
#include <catacomb/mprand.h>
#include <catacomb/mpcrt.h>
#include <catacomb/mpmont.h>
#include <catacomb/mpbarrett.h>
#include <catacomb/mpint.h>
#include <catacomb/mpmul.h>
#include <catacomb/mprand.h>
#include <catacomb/mpcrt.h>
#include <catacomb/mpmont.h>
#include <catacomb/mpbarrett.h>
extern U32 findconst(const struct consttab *cc,
const char *pkg, const char *name);
extern U32 findconst(const struct consttab *cc,
const char *pkg, const char *name);
+extern void ptrtosv(SV **sv, void *p, const char *type);
+extern void *ptrfromsv(SV *sv, const char *type, const char *what, ...);
#define SET(sv, ob, ty) sv_setref_pv((sv), (char *)(ty), (void *)(ob))
#define MAKE(ob, ty) SET(NEWSV(0, 0), ob, ty)
#define RET(ob, ty) SET(sv_newmortal(), ob, ty)
#define SET(sv, ob, ty) sv_setref_pv((sv), (char *)(ty), (void *)(ob))
#define MAKE(ob, ty) SET(NEWSV(0, 0), ob, ty)
#define RET(ob, ty) SET(sv_newmortal(), ob, ty)
extern const struct randtab mgftab[], ctrtab[], ofbtab[];
extern SV *findrand(const struct randtab *rt, const char *cls,
const char *name, SV *k);
extern void listrand(const struct randtab *rt);
extern const struct randtab mgftab[], ctrtab[], ofbtab[];
extern SV *findrand(const struct randtab *rt, const char *cls,
const char *name, SV *k);
extern void listrand(const struct randtab *rt);
+/*------ Key mangling -----------------------------------------------------*/
+
+typedef struct Key {
+ key_file *kf;
+ key *k;
+} Key;
+
+typedef int KeyErr;
+typedef key_data Key_Data;
+typedef key_file Key_File;
+
+extern void warn_keyreporter(const char *file, int line,
+ const char *err, void *p);
+extern SV *keyerr(int rc);
+
#define XSINTERFACE_FUNC_SETMP(cv, f) \
CvXSUBANY(cv).any_dptr = (void (*) _((void *)))(mp_##f)
#define XSINTERFACE_FUNC_SETMP(cv, f) \
CvXSUBANY(cv).any_dptr = (void (*) _((void *)))(mp_##f)
#define SET_MP(sv, x) SET(sv, x, "Catacomb::MP")
#define RET_MP(x) RET(x, "Catacomb::MP")
#define SET_MP(sv, x) SET(sv, x, "Catacomb::MP")
#define RET_MP(x) RET(x, "Catacomb::MP")
extern mp *mp_fromiv(mp *d, IV iv);
extern IV mp_toiv(mp *x);
extern mp *mp_readsv(mp *m, SV *sv, STRLEN *off, int radix);
extern int mp_writesv(mp *m, SV *sv, int radix);
extern mp *mp_fromiv(mp *d, IV iv);
extern IV mp_toiv(mp *x);
extern mp *mp_readsv(mp *m, SV *sv, STRLEN *off, int radix);
extern int mp_writesv(mp *m, SV *sv, int radix);
-extern mp *mp_fromsv(SV *sv, const char *what, int radix, int keep, ...);
+extern mp *mp_fromsv(SV *sv, const char *what, const char *ty,
+ int radix, int keep, ...);