summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/smp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c
index 3a1ce04a7a53..bf61e8841535 100644
--- a/net/bluetooth/smp.c
+++ b/net/bluetooth/smp.c
@@ -374,7 +374,7 @@ static int smp_h7(struct crypto_shash *tfm_cmac, const u8 w[16],
static int smp_e(const u8 *k, u8 *r)
{
- struct crypto_aes_ctx ctx;
+ struct aes_enckey aes;
uint8_t tmp[16], data[16];
int err;
@@ -383,7 +383,7 @@ static int smp_e(const u8 *k, u8 *r)
/* The most significant octet of key corresponds to k[0] */
swap_buf(k, tmp, 16);
- err = aes_expandkey(&ctx, tmp, 16);
+ err = aes_prepareenckey(&aes, tmp, 16);
if (err) {
BT_ERR("cipher setkey failed: %d", err);
return err;
@@ -392,14 +392,14 @@ static int smp_e(const u8 *k, u8 *r)
/* Most significant octet of plaintextData corresponds to data[0] */
swap_buf(r, data, 16);
- aes_encrypt(&ctx, data, data);
+ aes_encrypt(&aes, data, data);
/* Most significant octet of encryptedData corresponds to data[0] */
swap_buf(data, r, 16);
SMP_DBG("r %16phN", r);
- memzero_explicit(&ctx, sizeof(ctx));
+ memzero_explicit(&aes, sizeof(aes));
return err;
}