Loading...
Searching...
No Matches
keeloq_common.h
1#pragma once
2
3#include "base.h"
4
5#include <furi.h>
6
7/*
8 * Keeloq
9 * https://ru.wikipedia.org/wiki/KeeLoq
10 * https://phreakerclub.com/forum/showthread.php?t=1094
11 *
12 */
13#define KEELOQ_NLF 0x3A5C742E
14
15/*
16 * KeeLoq learning types
17 * https://phreakerclub.com/forum/showthread.php?t=67
18 */
19#define KEELOQ_LEARNING_UNKNOWN 0u
20#define KEELOQ_LEARNING_SIMPLE 1u
21#define KEELOQ_LEARNING_NORMAL 2u
22#define KEELOQ_LEARNING_SECURE 3u
23#define KEELOQ_LEARNING_MAGIC_XOR_TYPE_1 4u
24#define KEELOQ_LEARNING_MAGIC_SERIAL_TYPE_1 5u
25#define KEELOQ_LEARNING_MAGIC_SERIAL_TYPE_2 6u
26#define KEELOQ_LEARNING_MAGIC_SERIAL_TYPE_3 7u
27
34uint32_t subghz_protocol_keeloq_common_encrypt(const uint32_t data, const uint64_t key);
35
42uint32_t subghz_protocol_keeloq_common_decrypt(const uint32_t data, const uint64_t key);
43
50uint64_t subghz_protocol_keeloq_common_normal_learning(uint32_t data, const uint64_t key);
51
59uint64_t
60 subghz_protocol_keeloq_common_secure_learning(uint32_t data, uint32_t seed, const uint64_t key);
61
68uint64_t subghz_protocol_keeloq_common_magic_xor_type1_learning(uint32_t data, uint64_t xor);
69
76uint64_t subghz_protocol_keeloq_common_magic_serial_type1_learning(uint32_t data, uint64_t man);
77
84uint64_t subghz_protocol_keeloq_common_magic_serial_type2_learning(uint32_t data, uint64_t man);
85
92uint64_t subghz_protocol_keeloq_common_magic_serial_type3_learning(uint32_t data, uint64_t man);