]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
* rsa.c (rsa_init_private_key, rsa_clear_private_key): Handle d.
authorNiels Möller <nisse@lysator.liu.se>
Mon, 14 Jan 2002 20:09:32 +0000 (21:09 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Mon, 14 Jan 2002 20:09:32 +0000 (21:09 +0100)
* rsa.c (rsa_check_size): Changed argument to an mpz_t. Updated
callers.
(rsa_prepare_private_key): Compute the size of the key by
computing n = p * q.

* rsa.c (rsa_check_size): New function, for computing and checking
the size of the modulo in octets.
(rsa_prepare_public_key): Usa rsa_check_size.
(rsa_init_private_key): Removed code handling n, e and d.
(rsa_clear_private_key): Likewise.
(rsa_compute_root): Always use CRT.

Rev: src/nettle/rsa.c:1.6

rsa.c

diff --git a/rsa.c b/rsa.c
index bfc31348912a4ba8c5880ca29adb06925b8637e5..6dc8303352309298ee7bda73bda400a8d9e54bd8 100644 (file)
--- a/rsa.c
+++ b/rsa.c
@@ -94,6 +94,7 @@ rsa_prepare_public_key(struct rsa_public_key *key)
 void
 rsa_init_private_key(struct rsa_private_key *key)
 {
+  mpz_init(key->d);
   mpz_init(key->p);
   mpz_init(key->q);
   mpz_init(key->a);
@@ -108,6 +109,7 @@ rsa_init_private_key(struct rsa_private_key *key)
 void
 rsa_clear_private_key(struct rsa_private_key *key)
 {
+  mpz_clear(key->d);
   mpz_clear(key->p);
   mpz_clear(key->q);
   mpz_clear(key->a);