Joris's RSA works; reformat and remove old version
[u/mdw/putty] / ssh.h
CommitLineData
37508af4 1#include <string.h>
2
374330e2 3struct RSAKey {
4 int bits;
5 int bytes;
6 void *modulus;
7 void *exponent;
8};
9
10int makekey(unsigned char *data, struct RSAKey *result,
11 unsigned char **keystr);
12void rsaencrypt(unsigned char *data, int length, struct RSAKey *key);
13int rsastr_len(struct RSAKey *key);
14void rsastr_fmt(char *str, struct RSAKey *key);
15
16typedef unsigned int word32;
17typedef unsigned int uint32;
18
19unsigned long crc32(const unsigned char *s, unsigned int len);
20
21struct MD5Context {
22 uint32 buf[4];
23 uint32 bits[2];
24 unsigned char in[64];
25};
26
27void MD5Init(struct MD5Context *context);
28void MD5Update(struct MD5Context *context, unsigned char const *buf,
29 unsigned len);
30void MD5Final(unsigned char digest[16], struct MD5Context *context);
31
32struct ssh_cipher {
33 void (*sesskey)(unsigned char *key);
34 void (*encrypt)(unsigned char *blk, int len);
35 void (*decrypt)(unsigned char *blk, int len);
36};
37
38void SHATransform(word32 *digest, word32 *data);
39
40int random_byte(void);
41void random_add_noise(void *noise, int length);