diff options
author | Tudor Ambarus <tudor.ambarus@microchip.com> | 2017-09-28 16:14:51 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2017-10-06 20:35:47 +0200 |
commit | 47eb2ac809189e0a60ad78eec6db9e84004e11be (patch) | |
tree | a1974722296d4b7e82ba70a181dbc3ac0a005708 /net/bluetooth/ecdh_helper.h | |
parent | Bluetooth: btmrvl: *_err() and *_info() strings should end with newlines (diff) | |
download | linux-47eb2ac809189e0a60ad78eec6db9e84004e11be.tar.xz linux-47eb2ac809189e0a60ad78eec6db9e84004e11be.zip |
Bluetooth: move ecdh allocation outside of ecdh_helper
Before this change, a new crypto tfm was allocated, each time,
for both key generation and shared secret computation.
Allocate a single tfm for both cases.
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/ecdh_helper.h')
-rw-r--r-- | net/bluetooth/ecdh_helper.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/bluetooth/ecdh_helper.h b/net/bluetooth/ecdh_helper.h index 7a423faf76e5..5cde37d12fd9 100644 --- a/net/bluetooth/ecdh_helper.h +++ b/net/bluetooth/ecdh_helper.h @@ -20,8 +20,10 @@ * COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS * SOFTWARE IS DISCLAIMED. */ +#include <crypto/kpp.h> #include <linux/types.h> -bool compute_ecdh_secret(const u8 pub_a[64], const u8 priv_b[32], - u8 secret[32]); -bool generate_ecdh_keys(u8 public_key[64], u8 private_key[32]); +bool compute_ecdh_secret(struct crypto_kpp *tfm, const u8 pub_a[64], + const u8 priv_b[32], u8 secret[32]); +bool generate_ecdh_keys(struct crypto_kpp *tfm, u8 public_key[64], + u8 private_key[32]); |