Skip to content

Commit 8f44df1

Browse files
sfrothwellherbertx
authored andcommitted
crypto: ecdh - make ecdh_shared_secret unique
There is another ecdh_shared_secret in net/bluetooth/ecc.c Fixes: 3c4b239 ("crypto: ecdh - Add ECDH software support") Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 5214099 commit 8f44df1

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎crypto/ecc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ int ecdh_make_pub_key(unsigned int curve_id, unsigned int ndigits,
966966
return ret;
967967
}
968968

969-
int ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
969+
int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
970970
const u8 *private_key, unsigned int private_key_len,
971971
const u8 *public_key, unsigned int public_key_len,
972972
u8 *secret, unsigned int secret_len)

‎crypto/ecc.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int ecdh_make_pub_key(const unsigned int curve_id, unsigned int ndigits,
6060
u8 *public_key, unsigned int public_key_len);
6161

6262
/**
63-
* ecdh_shared_secret() - Compute a shared secret
63+
* crypto_ecdh_shared_secret() - Compute a shared secret
6464
*
6565
* @curve_id: id representing the curve to use
6666
* @private_key: private key of part A
@@ -70,13 +70,13 @@ int ecdh_make_pub_key(const unsigned int curve_id, unsigned int ndigits,
7070
* @secret: buffer for storing the calculated shared secret
7171
* @secret_len: length of the secret buffer
7272
*
73-
* Note: It is recommended that you hash the result of ecdh_shared_secret
73+
* Note: It is recommended that you hash the result of crypto_ecdh_shared_secret
7474
* before using it for symmetric encryption or HMAC.
7575
*
7676
* Returns 0 if the shared secret was generated successfully, a negative value
7777
* if an error occurred.
7878
*/
79-
int ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
79+
int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
8080
const u8 *private_key, unsigned int private_key_len,
8181
const u8 *public_key, unsigned int public_key_len,
8282
u8 *secret, unsigned int secret_len);

‎crypto/ecdh.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static int ecdh_compute_value(struct kpp_request *req)
7979
if (copied != 2 * nbytes)
8080
return -EINVAL;
8181

82-
ret = ecdh_shared_secret(ctx->curve_id, ctx->ndigits,
82+
ret = crypto_ecdh_shared_secret(ctx->curve_id, ctx->ndigits,
8383
(const u8 *)ctx->private_key, nbytes,
8484
(const u8 *)ctx->public_key, 2 * nbytes,
8585
(u8 *)ctx->shared_secret, nbytes);

0 commit comments

Comments
 (0)