Oops - move homepage location
[u/mdw/putty] / ssh.h
CommitLineData
37508af4 1#include <string.h>
2
bea1ef5f 3#define SSH_CIPHER_IDEA 1
9697bfd2 4#define SSH_CIPHER_DES 2
bea1ef5f 5#define SSH_CIPHER_3DES 3
6#define SSH_CIPHER_BLOWFISH 6
7
374330e2 8struct RSAKey {
9 int bits;
10 int bytes;
11 void *modulus;
12 void *exponent;
13};
14
15int makekey(unsigned char *data, struct RSAKey *result,
16 unsigned char **keystr);
17void rsaencrypt(unsigned char *data, int length, struct RSAKey *key);
18int rsastr_len(struct RSAKey *key);
19void rsastr_fmt(char *str, struct RSAKey *key);
20
21typedef unsigned int word32;
22typedef unsigned int uint32;
23
8160fbfc 24unsigned long crc32(const void *s, size_t len);
374330e2 25
26struct MD5Context {
27 uint32 buf[4];
28 uint32 bits[2];
29 unsigned char in[64];
30};
31
32void MD5Init(struct MD5Context *context);
33void MD5Update(struct MD5Context *context, unsigned char const *buf,
34 unsigned len);
35void MD5Final(unsigned char digest[16], struct MD5Context *context);
36
37struct ssh_cipher {
38 void (*sesskey)(unsigned char *key);
39 void (*encrypt)(unsigned char *blk, int len);
40 void (*decrypt)(unsigned char *blk, int len);
41};
42
43void SHATransform(word32 *digest, word32 *data);
44
45int random_byte(void);
46void random_add_noise(void *noise, int length);
c5e9c988 47
48void logevent (char *);