summaryrefslogtreecommitdiffstats
path: root/crypto/sm2/sm2_crypt.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-07-30 16:40:18 +0100
committerMatt Caswell <matt@openssl.org>2018-07-31 09:08:38 +0100
commit9cc570d4c419e2ca97e2173dc14c484195502dd4 (patch)
treec5ca35dd93fa1305ce979ff094e1755fb5b03c13 /crypto/sm2/sm2_crypt.c
parentde34e45a64f0865264b826255adbe7aee7470780 (diff)
Use the new non-curve type specific EC functions internally
Fixes #6646 Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/6815)
Diffstat (limited to 'crypto/sm2/sm2_crypt.c')
-rw-r--r--crypto/sm2/sm2_crypt.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/sm2/sm2_crypt.c b/crypto/sm2/sm2_crypt.c
index d6f9c81d8c..9e7887320c 100644
--- a/crypto/sm2/sm2_crypt.c
+++ b/crypto/sm2/sm2_crypt.c
@@ -48,7 +48,7 @@ static size_t ec_field_size(const EC_GROUP *group)
if (p == NULL || a == NULL || b == NULL)
goto done;
- if (!EC_GROUP_get_curve_GFp(group, p, a, b, NULL))
+ if (!EC_GROUP_get_curve(group, p, a, b, NULL))
goto done;
field_size = (BN_num_bits(p) + 7) / 8;
@@ -176,9 +176,9 @@ int sm2_encrypt(const EC_KEY *key,
}
if (!EC_POINT_mul(group, kG, k, NULL, NULL, ctx)
- || !EC_POINT_get_affine_coordinates_GFp(group, kG, x1, y1, ctx)
+ || !EC_POINT_get_affine_coordinates(group, kG, x1, y1, ctx)
|| !EC_POINT_mul(group, kP, NULL, P, k, ctx)
- || !EC_POINT_get_affine_coordinates_GFp(group, kP, x2, y2, ctx)) {
+ || !EC_POINT_get_affine_coordinates(group, kP, x2, y2, ctx)) {
SM2err(SM2_F_SM2_ENCRYPT, ERR_R_EC_LIB);
goto done;
}
@@ -326,11 +326,11 @@ int sm2_decrypt(const EC_KEY *key,
goto done;
}
- if (!EC_POINT_set_affine_coordinates_GFp(group, C1, sm2_ctext->C1x,
- sm2_ctext->C1y, ctx)
+ if (!EC_POINT_set_affine_coordinates(group, C1, sm2_ctext->C1x,
+ sm2_ctext->C1y, ctx)
|| !EC_POINT_mul(group, C1, NULL, C1, EC_KEY_get0_private_key(key),
ctx)
- || !EC_POINT_get_affine_coordinates_GFp(group, C1, x2, y2, ctx)) {
+ || !EC_POINT_get_affine_coordinates(group, C1, x2, y2, ctx)) {
SM2err(SM2_F_SM2_DECRYPT, ERR_R_EC_LIB);
goto done;
}