@@ -372,36 +372,36 @@ static int smp_h7(struct crypto_shash *tfm_cmac, const u8 w[16],
* s1 and ah.
*/
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;
SMP_DBG("k %16phN r %16phN", k, 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;
}
/* Most significant octet of plaintextData corresponds to data[0] */
swap_buf(r, data, 16);
- aes_encrypt(&ctx, data, data);
+ aes_encrypt_new(&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;
}
static int smp_c1(const u8 k[16],
const u8 r[16], const u8 preq[7], const u8 pres[7], u8 _iat,