comparison rsa.h @ 641:2b1bb792cd4d dropbear-tfm

- Update tfm changes to current default tip
author Matt Johnston <matt@ucc.asn.au>
date Mon, 21 Nov 2011 19:52:28 +0800
parents 76097ec1a29a b50f0107e505
children
comparison
equal deleted inserted replaced
640:76097ec1a29a 641:2b1bb792cd4d
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 fp_int* n; 37 fp_int* n;
38 fp_int* e; 38 fp_int* e;
39 /* d, p, and q are private parts */
39 fp_int* d; 40 fp_int* d;
40 fp_int* p; 41 fp_int* p;
41 fp_int* q; 42 fp_int* q;
42 43
43 }; 44 } dropbear_rsa_key;
44 45
45 typedef struct RSA_key rsa_key; 46 void buf_put_rsa_sign(buffer* buf, dropbear_rsa_key *key, const unsigned char* data,
46
47 void buf_put_rsa_sign(buffer* buf, rsa_key *key, const unsigned char* data,
48 unsigned int len); 47 unsigned int len);
49 #ifdef DROPBEAR_SIGNKEY_VERIFY 48 #ifdef DROPBEAR_SIGNKEY_VERIFY
50 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,
51 unsigned int len); 50 unsigned int len);
52 #endif 51 #endif
53 int buf_get_rsa_pub_key(buffer* buf, rsa_key *key); 52 int buf_get_rsa_pub_key(buffer* buf, dropbear_rsa_key *key);
54 int buf_get_rsa_priv_key(buffer* buf, rsa_key *key); 53 int buf_get_rsa_priv_key(buffer* buf, dropbear_rsa_key *key);
55 void buf_put_rsa_pub_key(buffer* buf, rsa_key *key); 54 void buf_put_rsa_pub_key(buffer* buf, dropbear_rsa_key *key);
56 void buf_put_rsa_priv_key(buffer* buf, rsa_key *key); 55 void buf_put_rsa_priv_key(buffer* buf, dropbear_rsa_key *key);
57 void rsa_key_free(rsa_key *key); 56 void rsa_key_free(dropbear_rsa_key *key);
58 57
59 #endif /* DROPBEAR_RSA */ 58 #endif /* DROPBEAR_RSA */
60 59
61 #endif /* _RSA_H_ */ 60 #endif /* _RSA_H_ */