correct cipher function

This commit is contained in:
r3df0xx
2022-04-09 03:05:16 +03:00
parent 004ce97548
commit 43a9df04c9
3 changed files with 4 additions and 6 deletions
+2 -2
View File
@@ -139,7 +139,7 @@ static bool subghz_protocol_faac_slh_gen_data(SubGhzProtocolEncoderFaacSLH* inst
case KEELOQ_LEARNING_FAAC:
//FAAC Learning
man =
subghz_protocol_keeloq_common_faac_learning(fix, seed, manufacture_code->key);
subghz_protocol_keeloq_common_faac_learning(seed, manufacture_code->key);
hop = subghz_protocol_keeloq_common_encrypt(decrypt, man);
break;
}
@@ -407,7 +407,7 @@ static void subghz_protocol_faac_slh_check_remote_controller
switch(manufacture_code->type) {
case KEELOQ_LEARNING_FAAC:
// FAAC Learning
man = subghz_protocol_keeloq_common_faac_learning(code_fix, seed, manufacture_code->key);
man = subghz_protocol_keeloq_common_faac_learning(seed, manufacture_code->key);
FURI_LOG_I(TAG, "mfkey: %08lX%08lX mf: %s", hi, lo, manufacture_code->name);
decrypt = subghz_protocol_keeloq_common_decrypt(code_hop, man);
*manufacture_name = string_get_cstr(manufacture_code->name);
+1 -2
View File
@@ -84,14 +84,13 @@ inline uint64_t
}
/** Faac SLH (Spa) Learning
* @param data - fix number (32bit)
* @param seed - seed number (32bit)
* @param key - mfkey (64bit)
* @return man_learning for this fix number (64bit)
*/
inline uint64_t
subghz_protocol_keeloq_common_faac_learning(uint32_t data, uint32_t seed, const uint32_t key) {
subghz_protocol_keeloq_common_faac_learning(uint32_t seed, const uint32_t key) {
uint32_t k1, k2;
uint16_t hs = seed >> 16;
uint32_t lsb = (uint32_t)hs << 16 | 0x544D;
+1 -2
View File
@@ -69,9 +69,8 @@ uint64_t
uint64_t subghz_protocol_keeloq_common_magic_xor_type1_learning(uint32_t data, uint64_t xor);
/** Faac SLH (Spa) Learning
* @param data - fix number (32bit)
* @param seed - seed number (32bit)
* @param key - mfkey (64bit)
* @return man_learning for this fix number (64bit)
*/
uint64_t subghz_protocol_keeloq_common_faac_learning(uint32_t data, uint32_t seed, const uint32_t key);
uint64_t subghz_protocol_keeloq_common_faac_learning(uint32_t seed, const uint32_t key);