summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dsa')
-rw-r--r--src/lib/libcrypto/dsa/dsa_ossl.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_ossl.c b/src/lib/libcrypto/dsa/dsa_ossl.c
index c3f01b0f11..61a20f41a7 100644
--- a/src/lib/libcrypto/dsa/dsa_ossl.c
+++ b/src/lib/libcrypto/dsa/dsa_ossl.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_ossl.c,v 1.17 2014/06/12 15:49:28 deraadt Exp $ */ 1/* $OpenBSD: dsa_ossl.c,v 1.18 2014/06/27 06:07:35 deraadt Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -97,24 +97,28 @@ static DSA_METHOD openssl_dsa_meth = {
97 97
98#define DSA_MOD_EXP(err_instr,dsa,rr,a1,p1,a2,p2,m,ctx,in_mont) \ 98#define DSA_MOD_EXP(err_instr,dsa,rr,a1,p1,a2,p2,m,ctx,in_mont) \
99 do { \ 99 do { \
100 int _tmp_res53; \ 100 int _tmp_res53; \
101 if((dsa)->meth->dsa_mod_exp) \ 101 if((dsa)->meth->dsa_mod_exp) \
102 _tmp_res53 = (dsa)->meth->dsa_mod_exp((dsa), (rr), (a1), (p1), \ 102 _tmp_res53 = (dsa)->meth->dsa_mod_exp((dsa), (rr), \
103 (a2), (p2), (m), (ctx), (in_mont)); \ 103 (a1), (p1), (a2), (p2), (m), (ctx), (in_mont)); \
104 else \ 104 else \
105 _tmp_res53 = BN_mod_exp2_mont((rr), (a1), (p1), (a2), (p2), \ 105 _tmp_res53 = BN_mod_exp2_mont((rr), (a1), \
106 (m), (ctx), (in_mont)); \ 106 (p1), (a2), (p2), (m), (ctx), (in_mont)); \
107 if(!_tmp_res53) err_instr; \ 107 if(!_tmp_res53) \
108 err_instr; \
108 } while(0) 109 } while(0)
110
109#define DSA_BN_MOD_EXP(err_instr,dsa,r,a,p,m,ctx,m_ctx) \ 111#define DSA_BN_MOD_EXP(err_instr,dsa,r,a,p,m,ctx,m_ctx) \
110 do { \ 112 do { \
111 int _tmp_res53; \ 113 int _tmp_res53; \
112 if((dsa)->meth->bn_mod_exp) \ 114 if((dsa)->meth->bn_mod_exp) \
113 _tmp_res53 = (dsa)->meth->bn_mod_exp((dsa), (r), (a), (p), \ 115 _tmp_res53 = (dsa)->meth->bn_mod_exp((dsa), (r), \
114 (m), (ctx), (m_ctx)); \ 116 (a), (p), (m), (ctx), (m_ctx)); \
115 else \ 117 else \
116 _tmp_res53 = BN_mod_exp_mont((r), (a), (p), (m), (ctx), (m_ctx)); \ 118 _tmp_res53 = BN_mod_exp_mont((r), (a), (p), (m), \
117 if(!_tmp_res53) err_instr; \ 119 (ctx), (m_ctx)); \
120 if(!_tmp_res53) \
121 err_instr; \
118 } while(0) 122 } while(0)
119 123
120const DSA_METHOD *DSA_OpenSSL(void) 124const DSA_METHOD *DSA_OpenSSL(void)