#ifndef _ALGS_H_76f0388d_ #define _ALGS_H_76f0388d_ #include typedef struct encalg ENCALG; typedef struct compalg COMPALG; typedef struct macalg MACALG; typedef struct kexalg KEXALG; typedef struct hkalg HKALG; typedef struct hashalg HASHALG; typedef struct uaalg UAALG; typedef struct alglist ALGLIST; #include "bpp.h" #include "str.h" #include "userauth.h" struct encalg { const char *name; int blksize; int ivsize; int keysize; void *(*init_enc)(const void *, const void *); void *(*init_dec)(const void *, const void *); void (*process)(void *, const void *, void *, int); void (*done)(void *); } ; struct compalg { const char *name; void *(*init_comp)(void); void *(*init_decomp)(void); void (*process)(void *, const void *, int, void (*)(const void *, int)); void (*flush)(void *, void (*)(const void *, int)); void (*done)(void *); } ; struct macalg { const char *name; int maclen; int keylen; void *(*init)(const void *); int (*check)(void *, const void *, int, ...); void (*gen)(void *, void *, int, ...); void (*done)(void *); } ; struct kexalg { const char *name; int need_enc; int need_sig; void *(*init)(LAYER *); int (*run)(LAYER *, void *); } ; struct hkalg { const char *name; int can_enc; int can_sig; /* BEGIN if can_sig */ HASHALG *(*prehash)(void); int (*checksig)(const void *, int, const void *, const void *, int); int (*sign)(STR *, const void *, int, const void *, int, const void *); /* END if can_sig */ void (*genkey)(FILE *, FILE *, int); int (*checkpub)(const void *, int); const char * const *altnames; const char *deffile; } ; struct hashalg { const char *name; int hashlen; void *(*init)(void); void (*process)(void *, const void *, int); void (*done)(void *, void *); } ; struct uaalg { const char *name; int (*canuse)(BPP *); unsigned char *(*start)(UASTATE *); int (*partial)(UASTATE *); int (*run)(UASTATE *); int (*retry)(UASTATE *); void (*done)(UASTATE *); } ; /* returns from partial and run methods */ #define UA_READ 1 #define UA_SEND 2 #define UA_NEXT 3 struct alglist { ALGLIST *link; void *alg; } ; extern void *encalg_vfind_c(const char *); extern void *encalg_vfind_rostr(ROSTR); extern const char *encalg_name(void *); extern void *encalg_enum(int); extern void *encalg_init(ENCALG *, const void *, const void *, char); extern int encalg_i(ENCALG *, void *, void (*)(const void *, int), const void *, int, int); extern void encalg_o(ENCALG *, void *, void (*)(const void *, int), const void *, int); extern void *compalg_vfind_c(const char *); extern void *compalg_vfind_rostr(ROSTR); extern const char *compalg_name(void *); extern void *compalg_enum(int); extern void *compalg_init(COMPALG *, char); extern void *macalg_vfind_c(const char *); extern void *macalg_vfind_rostr(ROSTR); extern const char *macalg_name(void *); extern void *macalg_enum(int); extern void *macalg_init(MACALG *, const void *); extern void *kexalg_vfind_c(const char *); extern void *kexalg_vfind_rostr(ROSTR); extern const char *kexalg_name(void *); extern void *kexalg_enum(int); extern void *hkalg_vfind_c(const char *); extern void *hkalg_vfind_rostr(ROSTR); extern const char *hkalg_name(void *); extern void *hkalg_enum(int); extern void *uaalg_vfind_c(const char *); extern void *uaalg_vfind_rostr(ROSTR); extern const char *uaalg_name(void *); extern void *uaalg_enum(int); extern void alglist_free(ALGLIST *); extern ENCALG *alglist_enc[]; extern COMPALG *alglist_comp[]; extern MACALG *alglist_mac[]; extern KEXALG *alglist_kex[]; extern HKALG *alglist_hk[]; extern HASHALG *alglist_hash[]; extern UAALG *alglist_ua[]; #endif