"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "crypto/ec/ec_mult.c" between
openssl-1.1.1f.tar.gz and openssl-1.1.1g.tar.gz

About: OpenSSL is a toolkit implementing the Transport Layer Security (TLS) protocols (including SSLv3) as well as a full-strength general purpose cryptographic library. Long Term Support (LTS) version (includes support for TLSv1.3).

ec_mult.c  (openssl-1.1.1f):ec_mult.c  (openssl-1.1.1g)
/* /*
* Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved. * Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
* *
* Licensed under the OpenSSL license (the "License"). You may not use * Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy * this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at * in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html * https://www.openssl.org/source/license.html
*/ */
#include <string.h> #include <string.h>
#include <openssl/err.h> #include <openssl/err.h>
skipping to change at line 263 skipping to change at line 263
|| (bn_wexpand(r->X, group_top) == NULL) || (bn_wexpand(r->X, group_top) == NULL)
|| (bn_wexpand(r->Y, group_top) == NULL) || (bn_wexpand(r->Y, group_top) == NULL)
|| (bn_wexpand(r->Z, group_top) == NULL) || (bn_wexpand(r->Z, group_top) == NULL)
|| (bn_wexpand(p->X, group_top) == NULL) || (bn_wexpand(p->X, group_top) == NULL)
|| (bn_wexpand(p->Y, group_top) == NULL) || (bn_wexpand(p->Y, group_top) == NULL)
|| (bn_wexpand(p->Z, group_top) == NULL)) { || (bn_wexpand(p->Z, group_top) == NULL)) {
ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB); ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_BN_LIB);
goto err; goto err;
} }
/*- /* ensure input point is in affine coords for ladder step efficiency */
* Apply coordinate blinding for EC_POINT. if (!p->Z_is_one && !EC_POINT_make_affine(group, p, ctx)) {
* ECerr(EC_F_EC_SCALAR_MUL_LADDER, ERR_R_EC_LIB);
* The underlying EC_METHOD can optionally implement this function: goto err;
* ec_point_blind_coordinates() returns 0 in case of errors or 1 on
* success or if coordinate blinding is not implemented for this
* group.
*/
if (!ec_point_blind_coordinates(group, p, ctx)) {
ECerr(EC_F_EC_SCALAR_MUL_LADDER, EC_R_POINT_COORDINATES_BLIND_FAILURE);
goto err;
} }
/* Initialize the Montgomery ladder */ /* Initialize the Montgomery ladder */
if (!ec_point_ladder_pre(group, r, s, p, ctx)) { if (!ec_point_ladder_pre(group, r, s, p, ctx)) {
ECerr(EC_F_EC_SCALAR_MUL_LADDER, EC_R_LADDER_PRE_FAILURE); ECerr(EC_F_EC_SCALAR_MUL_LADDER, EC_R_LADDER_PRE_FAILURE);
goto err; goto err;
} }
/* top bit is a 1, in a fixed pos */ /* top bit is a 1, in a fixed pos */
pbit = 1; pbit = 1;
skipping to change at line 750 skipping to change at line 743
goto err; goto err;
} }
r_is_inverted = !r_is_inverted; r_is_inverted = !r_is_inverted;
} }
/* digit > 0 */ /* digit > 0 */
if (r_is_at_infinity) { if (r_is_at_infinity) {
if (!EC_POINT_copy(r, val_sub[i][digit >> 1])) if (!EC_POINT_copy(r, val_sub[i][digit >> 1]))
goto err; goto err;
/*-
* Apply coordinate blinding for EC_POINT.
*
* The underlying EC_METHOD can optionally implement thi
s function:
* ec_point_blind_coordinates() returns 0 in case of err
ors or 1 on
* success or if coordinate blinding is not implemented
for this
* group.
*/
if (!ec_point_blind_coordinates(group, r, ctx)) {
ECerr(EC_F_EC_WNAF_MUL, EC_R_POINT_COORDINATES_BLIND
_FAILURE);
goto err;
}
r_is_at_infinity = 0; r_is_at_infinity = 0;
} else { } else {
if (!EC_POINT_add if (!EC_POINT_add
(group, r, r, val_sub[i][digit >> 1], ctx)) (group, r, r, val_sub[i][digit >> 1], ctx))
goto err; goto err;
} }
} }
} }
} }
} }
 End of changes. 3 change blocks. 
12 lines changed or deleted 23 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)