1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

keeeloq update

This commit is contained in:
MX
2022-09-22 18:01:54 +03:00
parent de6ff1d9c9
commit e13edc2f70
4 changed files with 101 additions and 47 deletions

View File

@@ -101,4 +101,15 @@ inline uint64_t
uint64_t man = (uint64_t)subghz_protocol_keeloq_common_encrypt(seed, key) << 32 |
subghz_protocol_keeloq_common_encrypt(lsb, key);
return man;
}
}
/** Magic_serial_type1 Learning
* @param data - serial number (28bit)
* @param man - magic man (64bit)
* @return manufacture for this serial number (64bit)
*/
inline uint64_t
subghz_protocol_keeloq_common_magic_serial_type1_learning(uint32_t data, uint64_t man) {
return man | ((uint64_t)data << 40) |
((uint64_t)(((data & 0xff) + ((data >> 8) & 0xFF)) & 0xFF) << 32);
}