crypto: ecdh - make ecdh_shared_secret unique
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 24 Jun 2016 06:20:22 +0000 (16:20 +1000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 24 Jun 2016 13:24:59 +0000 (21:24 +0800)
There is another ecdh_shared_secret in net/bluetooth/ecc.c

Fixes: 3c4b23901a0c ("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>
crypto/ecc.c
crypto/ecc.h
crypto/ecdh.c

index 9aedec6bbe728a5492fa1f340f8c19f6bf13da54..414c78a9c2143b700b7200dbf3216d285b93620c 100644 (file)
@@ -966,7 +966,7 @@ out:
        return ret;
 }
 
-int ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
+int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
                       const u8 *private_key, unsigned int private_key_len,
                       const u8 *public_key, unsigned int public_key_len,
                       u8 *secret, unsigned int secret_len)
index b5db4b989f3c54a9fbb2b435602f72d194392671..663d598c7406cd872552001867c0ceda5c776a94 100644 (file)
@@ -60,7 +60,7 @@ int ecdh_make_pub_key(const unsigned int curve_id, unsigned int ndigits,
                      u8 *public_key, unsigned int public_key_len);
 
 /**
- * ecdh_shared_secret() - Compute a shared secret
+ * crypto_ecdh_shared_secret() - Compute a shared secret
  *
  * @curve_id:          id representing the curve to use
  * @private_key:       private key of part A
@@ -70,13 +70,13 @@ int ecdh_make_pub_key(const unsigned int curve_id, unsigned int ndigits,
  * @secret:            buffer for storing the calculated shared secret
  * @secret_len:                length of the secret buffer
  *
- * Note: It is recommended that you hash the result of ecdh_shared_secret
+ * Note: It is recommended that you hash the result of crypto_ecdh_shared_secret
  * before using it for symmetric encryption or HMAC.
  *
  * Returns 0 if the shared secret was generated successfully, a negative value
  * if an error occurred.
  */
-int ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
+int crypto_ecdh_shared_secret(unsigned int curve_id, unsigned int ndigits,
                       const u8 *private_key, unsigned int private_key_len,
                       const u8 *public_key, unsigned int public_key_len,
                       u8 *secret, unsigned int secret_len);
index d3a9eeca4b326accf410426802707e1ff45d5813..3de289806d6784d0affcdc356d16a2fee3d31d65 100644 (file)
@@ -79,7 +79,7 @@ static int ecdh_compute_value(struct kpp_request *req)
                if (copied != 2 * nbytes)
                        return -EINVAL;
 
-               ret = ecdh_shared_secret(ctx->curve_id, ctx->ndigits,
+               ret = crypto_ecdh_shared_secret(ctx->curve_id, ctx->ndigits,
                                         (const u8 *)ctx->private_key, nbytes,
                                         (const u8 *)ctx->public_key, 2 * nbytes,
                                         (u8 *)ctx->shared_secret, nbytes);