summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ecp_mont.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ecp_mont.c')
-rw-r--r--src/lib/libcrypto/ec/ecp_mont.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/ec/ecp_mont.c b/src/lib/libcrypto/ec/ecp_mont.c
index a3ad4e1ce9..68fc26de1e 100644
--- a/src/lib/libcrypto/ec/ecp_mont.c
+++ b/src/lib/libcrypto/ec/ecp_mont.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecp_mont.c,v 1.10 2015/02/13 00:46:03 beck Exp $ */ 1/* $OpenBSD: ecp_mont.c,v 1.11 2017/01/29 17:49:23 beck Exp $ */
2/* 2/*
3 * Originally written by Bodo Moeller for the OpenSSL project. 3 * Originally written by Bodo Moeller for the OpenSSL project.
4 */ 4 */
@@ -203,7 +203,7 @@ ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a,
203 if (mont == NULL) 203 if (mont == NULL)
204 goto err; 204 goto err;
205 if (!BN_MONT_CTX_set(mont, p, ctx)) { 205 if (!BN_MONT_CTX_set(mont, p, ctx)) {
206 ECerr(EC_F_EC_GFP_MONT_GROUP_SET_CURVE, ERR_R_BN_LIB); 206 ECerror(ERR_R_BN_LIB);
207 goto err; 207 goto err;
208 } 208 }
209 one = BN_new(); 209 one = BN_new();
@@ -238,7 +238,7 @@ ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
238 const BIGNUM *b, BN_CTX *ctx) 238 const BIGNUM *b, BN_CTX *ctx)
239{ 239{
240 if (group->field_data1 == NULL) { 240 if (group->field_data1 == NULL) {
241 ECerr(EC_F_EC_GFP_MONT_FIELD_MUL, EC_R_NOT_INITIALIZED); 241 ECerror(EC_R_NOT_INITIALIZED);
242 return 0; 242 return 0;
243 } 243 }
244 return BN_mod_mul_montgomery(r, a, b, group->field_data1, ctx); 244 return BN_mod_mul_montgomery(r, a, b, group->field_data1, ctx);
@@ -250,7 +250,7 @@ ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
250 BN_CTX *ctx) 250 BN_CTX *ctx)
251{ 251{
252 if (group->field_data1 == NULL) { 252 if (group->field_data1 == NULL) {
253 ECerr(EC_F_EC_GFP_MONT_FIELD_SQR, EC_R_NOT_INITIALIZED); 253 ECerror(EC_R_NOT_INITIALIZED);
254 return 0; 254 return 0;
255 } 255 }
256 return BN_mod_mul_montgomery(r, a, a, group->field_data1, ctx); 256 return BN_mod_mul_montgomery(r, a, a, group->field_data1, ctx);
@@ -262,7 +262,7 @@ ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
262 BN_CTX *ctx) 262 BN_CTX *ctx)
263{ 263{
264 if (group->field_data1 == NULL) { 264 if (group->field_data1 == NULL) {
265 ECerr(EC_F_EC_GFP_MONT_FIELD_ENCODE, EC_R_NOT_INITIALIZED); 265 ECerror(EC_R_NOT_INITIALIZED);
266 return 0; 266 return 0;
267 } 267 }
268 return BN_to_montgomery(r, a, (BN_MONT_CTX *) group->field_data1, ctx); 268 return BN_to_montgomery(r, a, (BN_MONT_CTX *) group->field_data1, ctx);
@@ -274,7 +274,7 @@ ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a,
274 BN_CTX *ctx) 274 BN_CTX *ctx)
275{ 275{
276 if (group->field_data1 == NULL) { 276 if (group->field_data1 == NULL) {
277 ECerr(EC_F_EC_GFP_MONT_FIELD_DECODE, EC_R_NOT_INITIALIZED); 277 ECerror(EC_R_NOT_INITIALIZED);
278 return 0; 278 return 0;
279 } 279 }
280 return BN_from_montgomery(r, a, group->field_data1, ctx); 280 return BN_from_montgomery(r, a, group->field_data1, ctx);
@@ -285,7 +285,7 @@ int
285ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r, BN_CTX *ctx) 285ec_GFp_mont_field_set_to_one(const EC_GROUP *group, BIGNUM *r, BN_CTX *ctx)
286{ 286{
287 if (group->field_data2 == NULL) { 287 if (group->field_data2 == NULL) {
288 ECerr(EC_F_EC_GFP_MONT_FIELD_SET_TO_ONE, EC_R_NOT_INITIALIZED); 288 ECerror(EC_R_NOT_INITIALIZED);
289 return 0; 289 return 0;
290 } 290 }
291 if (!BN_copy(r, group->field_data2)) 291 if (!BN_copy(r, group->field_data2))