Bluetooth: hci_nxp: Improve MAC address uniqueness using CRC-32 hash
The previous method of deriving the local MAC address from the MCU's
Unique ID (UID) by slicing the last 3 bytes had two issues:
1. **Low Entropy:** Risk of address collision because only a small
portion of the UID was used, and this portion may not vary much.
2. **Offset Error:** An incorrect offset calculation could copy
non-intended bytes.
This commit resolves both issues by replacing the slice operation
with a **CRC-32 hash** over the **entire 16-byte UID**.
The lower 3 bytes (24 bits) of the resulting CRC-32 are used as the
local part of the MAC address, maximizing randomization and ensuring
a high probability of uniqueness across all devices.
Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
2 files changed