comparison rsa.h @ 1739:13d834efc376 fuzz

merge from main
author Matt Johnston <matt@ucc.asn.au>
date Thu, 15 Oct 2020 19:55:15 +0800
parents ae41624c2198
children
comparison
equal deleted inserted replaced
1562:768ebf737aa0 1739:13d834efc376
24 24
25 #ifndef DROPBEAR_RSA_H_ 25 #ifndef DROPBEAR_RSA_H_
26 #define DROPBEAR_RSA_H_ 26 #define DROPBEAR_RSA_H_
27 27
28 #include "includes.h" 28 #include "includes.h"
29 #include "signkey.h"
29 #include "buffer.h" 30 #include "buffer.h"
30 31
31 #if DROPBEAR_RSA 32 #if DROPBEAR_RSA
32 33
33 #define RSA_SIGNATURE_SIZE (4+7+4+40) 34 typedef struct dropbear_RSA_Key {
34
35 typedef struct {
36 35
37 mp_int* n; 36 mp_int* n;
38 mp_int* e; 37 mp_int* e;
39 /* d, p, and q are private parts */ 38 /* d, p, and q are private parts */
40 mp_int* d; 39 mp_int* d;
41 mp_int* p; 40 mp_int* p;
42 mp_int* q; 41 mp_int* q;
43 42
44 } dropbear_rsa_key; 43 } dropbear_rsa_key;
45 44
46 void buf_put_rsa_sign(buffer* buf, const dropbear_rsa_key *key, const buffer *data_buf); 45 void buf_put_rsa_sign(buffer* buf, const dropbear_rsa_key *key,
46 enum signature_type sigtype, const buffer *data_buf);
47 #if DROPBEAR_SIGNKEY_VERIFY 47 #if DROPBEAR_SIGNKEY_VERIFY
48 int buf_rsa_verify(buffer * buf, const dropbear_rsa_key *key, const buffer *data_buf); 48 int buf_rsa_verify(buffer * buf, const dropbear_rsa_key *key,
49 enum signature_type sigtype, const buffer *data_buf);
49 #endif 50 #endif
50 int buf_get_rsa_pub_key(buffer* buf, dropbear_rsa_key *key); 51 int buf_get_rsa_pub_key(buffer* buf, dropbear_rsa_key *key);
51 int buf_get_rsa_priv_key(buffer* buf, dropbear_rsa_key *key); 52 int buf_get_rsa_priv_key(buffer* buf, dropbear_rsa_key *key);
52 void buf_put_rsa_pub_key(buffer* buf, const dropbear_rsa_key *key); 53 void buf_put_rsa_pub_key(buffer* buf, const dropbear_rsa_key *key);
53 void buf_put_rsa_priv_key(buffer* buf, const dropbear_rsa_key *key); 54 void buf_put_rsa_priv_key(buffer* buf, const dropbear_rsa_key *key);