Mercurial > dropbear
comparison genrsa.c @ 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 | 657c045054ab |
children | a98a2138364a |
comparison
equal
deleted
inserted
replaced
585:d194db6f9453 | 586:b50f0107e505 |
---|---|
35 | 35 |
36 static void getrsaprime(mp_int* prime, mp_int *primeminus, | 36 static void getrsaprime(mp_int* prime, mp_int *primeminus, |
37 mp_int* rsa_e, unsigned int size); | 37 mp_int* rsa_e, unsigned int size); |
38 | 38 |
39 /* mostly taken from libtomcrypt's rsa key generation routine */ | 39 /* mostly taken from libtomcrypt's rsa key generation routine */ |
40 rsa_key * gen_rsa_priv_key(unsigned int size) { | 40 dropbear_rsa_key * gen_rsa_priv_key(unsigned int size) { |
41 | 41 |
42 rsa_key * key; | 42 dropbear_rsa_key * key; |
43 DEF_MP_INT(pminus); | 43 DEF_MP_INT(pminus); |
44 DEF_MP_INT(qminus); | 44 DEF_MP_INT(qminus); |
45 DEF_MP_INT(lcm); | 45 DEF_MP_INT(lcm); |
46 | 46 |
47 key = (rsa_key*)m_malloc(sizeof(rsa_key)); | 47 key = m_malloc(sizeof(*key)); |
48 | 48 |
49 key->e = (mp_int*)m_malloc(sizeof(mp_int)); | 49 key->e = (mp_int*)m_malloc(sizeof(mp_int)); |
50 key->n = (mp_int*)m_malloc(sizeof(mp_int)); | 50 key->n = (mp_int*)m_malloc(sizeof(mp_int)); |
51 key->d = (mp_int*)m_malloc(sizeof(mp_int)); | 51 key->d = (mp_int*)m_malloc(sizeof(mp_int)); |
52 key->p = (mp_int*)m_malloc(sizeof(mp_int)); | 52 key->p = (mp_int*)m_malloc(sizeof(mp_int)); |