Mercurial > dropbear
diff rsa.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 | a124aff0cbf1 |
children | a98a2138364a |
line wrap: on
line diff
--- a/rsa.c Wed Jul 21 12:38:46 2010 +0000 +++ b/rsa.c Wed Jul 21 12:55:25 2010 +0000 @@ -38,7 +38,7 @@ #ifdef DROPBEAR_RSA -static void rsa_pad_em(rsa_key * key, +static void rsa_pad_em(dropbear_rsa_key * key, const unsigned char * data, unsigned int len, mp_int * rsa_em); @@ -46,7 +46,7 @@ * The key will have the same format as buf_put_rsa_key. * These should be freed with rsa_key_free. * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ -int buf_get_rsa_pub_key(buffer* buf, rsa_key *key) { +int buf_get_rsa_pub_key(buffer* buf, dropbear_rsa_key *key) { int ret = DROPBEAR_FAILURE; TRACE(("enter buf_get_rsa_pub_key")) @@ -84,7 +84,7 @@ /* Same as buf_get_rsa_pub_key, but reads private bits at the end. * Loads a private rsa key from a buffer * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ -int buf_get_rsa_priv_key(buffer* buf, rsa_key *key) { +int buf_get_rsa_priv_key(buffer* buf, dropbear_rsa_key *key) { int ret = DROPBEAR_FAILURE; TRACE(("enter buf_get_rsa_priv_key")) @@ -137,7 +137,7 @@ /* Clear and free the memory used by a public or private key */ -void rsa_key_free(rsa_key *key) { +void rsa_key_free(dropbear_rsa_key *key) { TRACE(("enter rsa_key_free")) @@ -175,7 +175,7 @@ * mp_int e * mp_int n */ -void buf_put_rsa_pub_key(buffer* buf, rsa_key *key) { +void buf_put_rsa_pub_key(buffer* buf, dropbear_rsa_key *key) { TRACE(("enter buf_put_rsa_pub_key")) dropbear_assert(key != NULL); @@ -189,7 +189,7 @@ } /* Same as buf_put_rsa_pub_key, but with the private "x" key appended */ -void buf_put_rsa_priv_key(buffer* buf, rsa_key *key) { +void buf_put_rsa_priv_key(buffer* buf, dropbear_rsa_key *key) { TRACE(("enter buf_put_rsa_priv_key")) @@ -213,7 +213,7 @@ #ifdef DROPBEAR_SIGNKEY_VERIFY /* Verify a signature in buf, made on data by the key given. * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ -int buf_rsa_verify(buffer * buf, rsa_key *key, const unsigned char* data, +int buf_rsa_verify(buffer * buf, dropbear_rsa_key *key, const unsigned char* data, unsigned int len) { unsigned int slen; @@ -270,7 +270,7 @@ /* Sign the data presented with key, writing the signature contents * to the buffer */ -void buf_put_rsa_sign(buffer* buf, rsa_key *key, const unsigned char* data, +void buf_put_rsa_sign(buffer* buf, dropbear_rsa_key *key, const unsigned char* data, unsigned int len) { unsigned int nsize, ssize; @@ -376,7 +376,7 @@ * * rsa_em must be a pointer to an initialised mp_int. */ -static void rsa_pad_em(rsa_key * key, +static void rsa_pad_em(dropbear_rsa_key * key, const unsigned char * data, unsigned int len, mp_int * rsa_em) {