7 #define lenof(x) ( (sizeof((x))) / (sizeof(*(x))))
10 #define SSH_CIPHER_IDEA 1
11 #define SSH_CIPHER_DES 2
12 #define SSH_CIPHER_3DES 3
13 #define SSH_CIPHER_BLOWFISH 6
25 unsigned long exponent;
26 unsigned char *modulus;
33 int makekey(unsigned char *data, struct RSAKey *result,
34 unsigned char **keystr);
35 void rsaencrypt(unsigned char *data, int length, struct RSAKey *key);
36 int rsastr_len(struct RSAKey *key);
37 void rsastr_fmt(char *str, struct RSAKey *key);
39 typedef unsigned int word32;
40 typedef unsigned int uint32;
42 unsigned long crc32(const void *s, size_t len);
53 unsigned char block[64];
59 void MD5Init(struct MD5Context *context);
60 void MD5Update(struct MD5Context *context, unsigned char const *buf,
62 void MD5Final(unsigned char digest[16], struct MD5Context *context);
66 unsigned char block[64];
71 void SHA_Init(SHA_State *s);
72 void SHA_Bytes(SHA_State *s, void *p, int len);
73 void SHA_Final(SHA_State *s, unsigned char *output);
76 void (*sesskey)(unsigned char *key);
77 void (*encrypt)(unsigned char *blk, int len);
78 void (*decrypt)(unsigned char *blk, int len);
84 void (*sesskey)(unsigned char *key, int len);
85 void (*generate)(unsigned char *blk, int len, unsigned long seq);
86 int (*verify)(unsigned char *blk, int len, unsigned long seq);
104 void SHATransform(word32 *digest, word32 *data);
107 int random_byte(void);
108 void random_add_noise(void *noise, int length);
110 void logevent (char *);
113 * A Bignum is stored as a sequence of `unsigned short' words. The
114 * first tells how many remain; the remaining ones are digits, LS
117 typedef unsigned short *Bignum;
119 Bignum newbn(int length);
120 void freebn(Bignum b);
121 void modpow(Bignum base, Bignum exp, Bignum mod, Bignum result);
123 Bignum dh_create_e(void);
124 Bignum dh_find_K(Bignum f);