Mercurial > dropbear
comparison rsa.h @ 586:b50f0107e505
Rename rsa_key to dropbear_rsa_key (and same for dss too) so
we don't conflict with libtomcrypt.
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Wed, 21 Jul 2010 12:55:25 +0000 |
parents | 0442c18da5c9 |
children | 2b1bb792cd4d f336d232fc63 |
comparison
equal
deleted
inserted
replaced
585:d194db6f9453 | 586:b50f0107e505 |
---|---|
30 | 30 |
31 #ifdef DROPBEAR_RSA | 31 #ifdef DROPBEAR_RSA |
32 | 32 |
33 #define RSA_SIGNATURE_SIZE 4+7+4+40 | 33 #define RSA_SIGNATURE_SIZE 4+7+4+40 |
34 | 34 |
35 struct RSA_key { | 35 typedef struct { |
36 | 36 |
37 mp_int* n; | 37 mp_int* n; |
38 mp_int* e; | 38 mp_int* e; |
39 /* d, p, and q are private parts */ | 39 /* d, p, and q are private parts */ |
40 mp_int* d; | 40 mp_int* d; |
41 mp_int* p; | 41 mp_int* p; |
42 mp_int* q; | 42 mp_int* q; |
43 | 43 |
44 }; | 44 } dropbear_rsa_key; |
45 | 45 |
46 typedef struct RSA_key rsa_key; | 46 void buf_put_rsa_sign(buffer* buf, dropbear_rsa_key *key, const unsigned char* data, |
47 | |
48 void buf_put_rsa_sign(buffer* buf, rsa_key *key, const unsigned char* data, | |
49 unsigned int len); | 47 unsigned int len); |
50 #ifdef DROPBEAR_SIGNKEY_VERIFY | 48 #ifdef DROPBEAR_SIGNKEY_VERIFY |
51 int buf_rsa_verify(buffer * buf, rsa_key *key, const unsigned char* data, | 49 int buf_rsa_verify(buffer * buf, dropbear_rsa_key *key, const unsigned char* data, |
52 unsigned int len); | 50 unsigned int len); |
53 #endif | 51 #endif |
54 int buf_get_rsa_pub_key(buffer* buf, rsa_key *key); | 52 int buf_get_rsa_pub_key(buffer* buf, dropbear_rsa_key *key); |
55 int buf_get_rsa_priv_key(buffer* buf, rsa_key *key); | 53 int buf_get_rsa_priv_key(buffer* buf, dropbear_rsa_key *key); |
56 void buf_put_rsa_pub_key(buffer* buf, rsa_key *key); | 54 void buf_put_rsa_pub_key(buffer* buf, dropbear_rsa_key *key); |
57 void buf_put_rsa_priv_key(buffer* buf, rsa_key *key); | 55 void buf_put_rsa_priv_key(buffer* buf, dropbear_rsa_key *key); |
58 void rsa_key_free(rsa_key *key); | 56 void rsa_key_free(dropbear_rsa_key *key); |
59 | 57 |
60 #endif /* DROPBEAR_RSA */ | 58 #endif /* DROPBEAR_RSA */ |
61 | 59 |
62 #endif /* _RSA_H_ */ | 60 #endif /* _RSA_H_ */ |