diff options
author | Adam Langley <agl@google.com> | 2015-09-24 22:57:25 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-24 22:57:25 +0000 |
commit | 3781a60670f92c3c6fca860cb4589495cefa2e56 (patch) | |
tree | dd743d9d64af3145fe96b8d5fc2f3427544794bd /src/crypto/ec/simple.c | |
parent | 4ca36931e543512682d75e8e6d923144261dfd4d (diff) | |
parent | 1e4884f615b20946411a74e41eb9c6aa65e2d5f3 (diff) | |
download | external_boringssl-3781a60670f92c3c6fca860cb4589495cefa2e56.zip external_boringssl-3781a60670f92c3c6fca860cb4589495cefa2e56.tar.gz external_boringssl-3781a60670f92c3c6fca860cb4589495cefa2e56.tar.bz2 |
am 1e4884f6: external/boringssl: sync with upstream.
* commit '1e4884f615b20946411a74e41eb9c6aa65e2d5f3':
external/boringssl: sync with upstream.
Diffstat (limited to 'src/crypto/ec/simple.c')
-rw-r--r-- | src/crypto/ec/simple.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/crypto/ec/simple.c b/src/crypto/ec/simple.c index 69fd2e4..c62199c 100644 --- a/src/crypto/ec/simple.c +++ b/src/crypto/ec/simple.c @@ -172,7 +172,7 @@ int ec_GFp_simple_group_set_curve(EC_GROUP *group, const BIGNUM *p, /* p must be a prime > 3 */ if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) { - OPENSSL_PUT_ERROR(EC, ec_GFp_simple_group_set_curve, EC_R_INVALID_FIELD); + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); return 0; } @@ -283,8 +283,7 @@ int ec_GFp_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX *ctx) { if (ctx == NULL) { ctx = new_ctx = BN_CTX_new(); if (ctx == NULL) { - OPENSSL_PUT_ERROR(EC, ec_GFp_simple_group_check_discriminant, - ERR_R_MALLOC_FAILURE); + OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); goto err; } } @@ -492,8 +491,7 @@ int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *group, const BIGNUM *y, BN_CTX *ctx) { if (x == NULL || y == NULL) { /* unlike for projective coordinates, we do not tolerate this */ - OPENSSL_PUT_ERROR(EC, ec_GFp_simple_point_set_affine_coordinates, - ERR_R_PASSED_NULL_PARAMETER); + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return 0; } @@ -510,8 +508,7 @@ int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group, int ret = 0; if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, ec_GFp_simple_point_get_affine_coordinates, - EC_R_POINT_AT_INFINITY); + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); return 0; } @@ -527,7 +524,7 @@ int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group, Z_1 = BN_CTX_get(ctx); Z_2 = BN_CTX_get(ctx); Z_3 = BN_CTX_get(ctx); - if (Z_3 == NULL) { + if (Z == NULL || Z_1 == NULL || Z_2 == NULL || Z_3 == NULL) { goto err; } @@ -560,8 +557,7 @@ int ec_GFp_simple_point_get_affine_coordinates(const EC_GROUP *group, } } else { if (!BN_mod_inverse(Z_1, Z_, &group->field, ctx)) { - OPENSSL_PUT_ERROR(EC, ec_GFp_simple_point_get_affine_coordinates, - ERR_R_BN_LIB); + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); goto err; } @@ -1183,7 +1179,7 @@ int ec_GFp_simple_make_affine(const EC_GROUP *group, EC_POINT *point, goto err; } if (!point->Z_is_one) { - OPENSSL_PUT_ERROR(EC, ec_GFp_simple_make_affine, ERR_R_INTERNAL_ERROR); + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); goto err; } @@ -1269,7 +1265,7 @@ int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num, * non-zero points[i]->Z by its inverse. */ if (!BN_mod_inverse(tmp, prod_Z[num - 1], &group->field, ctx)) { - OPENSSL_PUT_ERROR(EC, ec_GFp_simple_points_make_affine, ERR_R_BN_LIB); + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); goto err; } |