Update keeloq_common.c

This commit is contained in:
r3df0xx 2022-04-09 04:33:32 +03:00
parent d033b102ea
commit dbe1d9114e

View File

@ -91,11 +91,10 @@ inline uint64_t
inline uint64_t
subghz_protocol_keeloq_common_faac_learning(const uint32_t seed, const uint32_t key) {
uint32_t k1, k2;
uint16_t hs = seed >> 16;
const uint16_t ending = 0x544D;
uint32_t lsb = (uint32_t)hs << 16 | ending;
k1 = subghz_protocol_keeloq_common_encrypt(seed, key);
k2 = subghz_protocol_keeloq_common_encrypt(lsb, key);
return ((uint64_t)k1 << 32) | k2;
uint64_t man = (uint64_t)subghz_protocol_keeloq_common_encrypt(seed, key) << 32 |
subghz_protocol_keeloq_common_encrypt(lsb, key);
return man;
}