From 9b14aed90887e1ec35830d60eea9ebde6a2cf814 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 7 Jan 2022 19:44:10 +0200 Subject: [PATCH] crypto: Remove unused crypto_ec_point_solve_y_coord() This wrapper function is not used anymore, so remove it. Signed-off-by: Jouni Malinen --- src/crypto/crypto.h | 12 ------------ src/crypto/crypto_openssl.c | 15 --------------- src/crypto/crypto_wolfssl.c | 24 ------------------------ 3 files changed, 51 deletions(-) diff --git a/src/crypto/crypto.h b/src/crypto/crypto.h index eb600699d..e6150b0cf 100644 --- a/src/crypto/crypto.h +++ b/src/crypto/crypto.h @@ -882,18 +882,6 @@ int crypto_ec_point_mul(struct crypto_ec *e, const struct crypto_ec_point *p, */ int crypto_ec_point_invert(struct crypto_ec *e, struct crypto_ec_point *p); -/** - * crypto_ec_point_solve_y_coord - Solve y coordinate for an x coordinate - * @e: EC context from crypto_ec_init() - * @p: EC point to use for the returning the result - * @x: x coordinate - * @y_bit: y-bit (0 or 1) for selecting the y value to use - * Returns: 0 on success, -1 on failure - */ -int crypto_ec_point_solve_y_coord(struct crypto_ec *e, - struct crypto_ec_point *p, - const struct crypto_bignum *x, int y_bit); - /** * crypto_ec_point_compute_y_sqr - Compute y^2 = x^3 + ax + b * @e: EC context from crypto_ec_init() diff --git a/src/crypto/crypto_openssl.c b/src/crypto/crypto_openssl.c index b178553e6..82c85762d 100644 --- a/src/crypto/crypto_openssl.c +++ b/src/crypto/crypto_openssl.c @@ -1951,21 +1951,6 @@ int crypto_ec_point_invert(struct crypto_ec *e, struct crypto_ec_point *p) } -int crypto_ec_point_solve_y_coord(struct crypto_ec *e, - struct crypto_ec_point *p, - const struct crypto_bignum *x, int y_bit) -{ - if (TEST_FAIL()) - return -1; - if (!EC_POINT_set_compressed_coordinates_GFp(e->group, (EC_POINT *) p, - (const BIGNUM *) x, y_bit, - e->bnctx) || - !EC_POINT_is_on_curve(e->group, (EC_POINT *) p, e->bnctx)) - return -1; - return 0; -} - - struct crypto_bignum * crypto_ec_point_compute_y_sqr(struct crypto_ec *e, const struct crypto_bignum *x) diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c index 6f116eb62..00ecf6135 100644 --- a/src/crypto/crypto_wolfssl.c +++ b/src/crypto/crypto_wolfssl.c @@ -1630,30 +1630,6 @@ int crypto_ec_point_invert(struct crypto_ec *e, struct crypto_ec_point *p) } -int crypto_ec_point_solve_y_coord(struct crypto_ec *e, - struct crypto_ec_point *p, - const struct crypto_bignum *x, int y_bit) -{ - byte buf[1 + 2 * MAX_ECC_BYTES]; - int ret; - int prime_len = crypto_ec_prime_len(e); - - if (TEST_FAIL()) - return -1; - - buf[0] = y_bit ? ECC_POINT_COMP_ODD : ECC_POINT_COMP_EVEN; - ret = crypto_bignum_to_bin(x, buf + 1, prime_len, prime_len); - if (ret <= 0) - return -1; - ret = wc_ecc_import_point_der(buf, 1 + 2 * ret, e->key.idx, - (ecc_point *) p); - if (ret != 0) - return -1; - - return 0; -} - - struct crypto_bignum * crypto_ec_point_compute_y_sqr(struct crypto_ec *e, const struct crypto_bignum *x)