|
37 | 37 | #include "lll_tim_internal.h" |
38 | 38 | #include "lll_prof_internal.h" |
39 | 39 |
|
40 | | -#include "hal/nrf5/ccm_mode2_soft.h" |
41 | | - |
42 | 40 | #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER) |
43 | 41 | #define LOG_MODULE_NAME bt_ctlr_lll_conn |
44 | 42 | #include "common/log.h" |
@@ -984,39 +982,6 @@ static inline int isr_rx_pdu(struct lll_conn *lll, struct pdu_data *pdu_data_rx, |
984 | 982 | struct pdu_data *scratch_pkt = |
985 | 983 | radio_pkt_scratch_get(); |
986 | 984 |
|
987 | | - static uint8_t decrypted_data[64]; |
988 | | - uint8_t nonce[CCM_NONCE_LENGTH]; |
989 | | - ccm_soft_data_t ccm_params; |
990 | | - //ccm_params.p_nonce = nonce; |
991 | | - ccm_params.p_m = scratch_pkt->lldata; |
992 | | - ccm_params.m_len = scratch_pkt->len; |
993 | | - ccm_params.p_out = decrypted_data; |
994 | | - ccm_params.p_key = lll->ccm_rx.key; |
995 | | - uint16_t event_counter = lll->event_counter - 1; |
996 | | - nonce[0] = (uint8_t)event_counter; |
997 | | - nonce[1] = (uint8_t)(event_counter >> 8); |
998 | | - nonce[2] = 0; |
999 | | - nonce[3] = 0; |
1000 | | - nonce[4] = 0; |
1001 | | - // nonce[0] = (uint8_t)lll->ccm_rx.counter; |
1002 | | - // nonce[1] = (uint8_t)(lll->ccm_rx.counter >> 8); |
1003 | | - // nonce[2] = (uint8_t)(lll->ccm_rx.counter >> 16); |
1004 | | - // nonce[3] = (uint8_t)(lll->ccm_rx.counter >> 24); |
1005 | | - // nonce[4] = (uint8_t)(lll->ccm_rx.counter >> 32); |
1006 | | - // nonce[4] = nonce[4] & 0x7F; |
1007 | | - nonce[4] = nonce[4] | (lll->ccm_rx.direction << 7); |
1008 | | - nonce[5] = (uint8_t)lll->ccm_rx.iv[0]; |
1009 | | - nonce[6] = (uint8_t)lll->ccm_rx.iv[1]; |
1010 | | - nonce[7] = (uint8_t)lll->ccm_rx.iv[2]; |
1011 | | - nonce[8] = (uint8_t)lll->ccm_rx.iv[3]; |
1012 | | - nonce[9] = (uint8_t)lll->ccm_rx.iv[4]; |
1013 | | - nonce[10] = (uint8_t)lll->ccm_rx.iv[5]; |
1014 | | - nonce[11] = (uint8_t)lll->ccm_rx.iv[6]; |
1015 | | - nonce[12] = (uint8_t)lll->ccm_rx.iv[7]; |
1016 | | - ccm_params.p_nonce = nonce; |
1017 | | - |
1018 | | - ccm_mode2_soft_decrypt(&ccm_params); |
1019 | | - |
1020 | 985 | if (ctrl_pdu_len_check( |
1021 | 986 | scratch_pkt->len)) { |
1022 | 987 | memcpy(pdu_data_rx, |
|
0 commit comments