summaryrefslogtreecommitdiff
path: root/rsa.c
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2002-01-09 16:14:39 +0100
committerNiels Möller <nisse@lysator.liu.se>2002-01-09 16:14:39 +0100
commit6e0c5d8e9872a059eaed2afd7ef22fbcfd9f545d (patch)
tree3c88779a7c22871c14a2e264e1b7f4dfd9e8fa64 /rsa.c
parent5cb171eb6de47dae287e8bdd47f7abfef437ff47 (diff)
downloadnettle-6e0c5d8e9872a059eaed2afd7ef22fbcfd9f545d.tar.gz
* rsa_md5.c: Represent a signature as an mpz_t, not a string.
Updated calls of md5 functions. * rsa_sha1.c: Likewise. * rsa.c (rsa_prepare_public_key): Renamed function, was rsa_init_public_key. (rsa_prepare_private_key): Renamed function, was rsa_init_private_key. Rev: src/nettle/rsa.c:1.2 Rev: src/nettle/rsa.h:1.3 Rev: src/nettle/rsa_md5.c:1.2 Rev: src/nettle/rsa_sha1.c:1.2
Diffstat (limited to 'rsa.c')
-rw-r--r--rsa.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/rsa.c b/rsa.c
index 2e360fb9..6c69eb02 100644
--- a/rsa.c
+++ b/rsa.c
@@ -38,7 +38,7 @@
* verify functions. */
int
-rsa_init_public_key(struct rsa_public_key *key)
+rsa_prepare_public_key(struct rsa_public_key *key)
{
unsigned size = (mpz_sizeinbase(key->n, 2) + 7) / 8;
@@ -64,23 +64,22 @@ rsa_init_public_key(struct rsa_public_key *key)
}
int
-rsa_init_private_key(struct rsa_private_key *key)
+rsa_prepare_private_key(struct rsa_private_key *key)
{
- return rsa_init_public_key(&key->pub);
+ return rsa_prepare_public_key(&key->pub);
}
#ifndef RSA_CRT
#define RSA_CRT 1
#endif
-/* Internal function for computing an rsa root.
+/* Computing an rsa root.
*
- * NOTE: We don't really need n not e, so we could delete the public
- * key info from struct rsa_private_key. We do need the size,
- * though. */
+ * NOTE: We don't really need n not e, so we could drop the public
+ * key info from struct rsa_private_key. */
void
-rsa_compute_root(struct rsa_private_key *key, mpz_t x, mpz_t m)
+rsa_compute_root(struct rsa_private_key *key, mpz_t x, const mpz_t m)
{
#if RSA_CRT
{