summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_x931p.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bn/bn_x931p.c')
-rw-r--r--src/lib/libcrypto/bn/bn_x931p.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_x931p.c b/src/lib/libcrypto/bn/bn_x931p.c
index 1948bc8e71..84c998d4e1 100644
--- a/src/lib/libcrypto/bn/bn_x931p.c
+++ b/src/lib/libcrypto/bn/bn_x931p.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bn_x931p.c,v 1.8 2015/04/29 00:11:12 doug Exp $ */ 1/* $OpenBSD: bn_x931p.c,v 1.9 2017/01/21 11:00:46 beck Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2005. 3 * project 2005.
4 */ 4 */
@@ -59,6 +59,8 @@
59#include <stdio.h> 59#include <stdio.h>
60#include <openssl/bn.h> 60#include <openssl/bn.h>
61 61
62#include "bn_lcl.h"
63
62/* X9.31 routines for prime derivation */ 64/* X9.31 routines for prime derivation */
63 65
64/* X9.31 prime derivation. This is used to generate the primes pi 66/* X9.31 prime derivation. This is used to generate the primes pi
@@ -134,13 +136,13 @@ BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, const BIGNUM *Xp,
134 136
135 /* First set p to value of Rp */ 137 /* First set p to value of Rp */
136 138
137 if (!BN_mod_inverse(p, p2, p1, ctx)) 139 if (!BN_mod_inverse_ct(p, p2, p1, ctx))
138 goto err; 140 goto err;
139 141
140 if (!BN_mul(p, p, p2, ctx)) 142 if (!BN_mul(p, p, p2, ctx))
141 goto err; 143 goto err;
142 144
143 if (!BN_mod_inverse(t, p1, p2, ctx)) 145 if (!BN_mod_inverse_ct(t, p1, p2, ctx))
144 goto err; 146 goto err;
145 147
146 if (!BN_mul(t, t, p1, ctx)) 148 if (!BN_mul(t, t, p1, ctx))