summaryrefslogtreecommitdiff
path: root/rsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'rsa.c')
-rw-r--r--rsa.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/rsa.c b/rsa.c
index 626553149..f69f99606 100644
--- a/rsa.c
+++ b/rsa.c
@@ -60,7 +60,7 @@
60 */ 60 */
61 61
62#include "includes.h" 62#include "includes.h"
63RCSID("$OpenBSD: rsa.c,v 1.21 2001/02/04 15:32:24 stevesk Exp $"); 63RCSID("$OpenBSD: rsa.c,v 1.22 2001/03/26 23:23:23 markus Exp $");
64 64
65#include "rsa.h" 65#include "rsa.h"
66#include "log.h" 66#include "log.h"
@@ -119,3 +119,23 @@ rsa_private_decrypt(BIGNUM *out, BIGNUM *in, RSA *key)
119 xfree(inbuf); 119 xfree(inbuf);
120 return len; 120 return len;
121} 121}
122
123void
124generate_additional_parameters(RSA *rsa)
125{
126 BIGNUM *aux;
127 BN_CTX *ctx;
128 /* Generate additional parameters */
129 aux = BN_new();
130 ctx = BN_CTX_new();
131
132 BN_sub(aux, rsa->q, BN_value_one());
133 BN_mod(rsa->dmq1, rsa->d, aux, ctx);
134
135 BN_sub(aux, rsa->p, BN_value_one());
136 BN_mod(rsa->dmp1, rsa->d, aux, ctx);
137
138 BN_clear_free(aux);
139 BN_CTX_free(ctx);
140}
141