mirror of
https://protopirate.net/ProtoPirate/ProtoPirate.git
synced 2026-06-07 06:51:40 +00:00
@xMasterX --> Refactor key handling and add key loading function
Replaces obfuscated key macros and inline functions with external key variables and function declarations. Adds protopirate_keys_load to initialize keys using a SubGhzEnvironment. Updates includes to use subghz environment and keystore headers.
This commit is contained in:
+10
-21
@@ -2,28 +2,17 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// Mask - hint THEPIRAT
|
||||
#define KEY_OBFUSCATION_MASK 0x5448455049524154ULL
|
||||
#include <lib/subghz/environment.h>
|
||||
#include <lib/subghz/subghz_keystore.h>
|
||||
|
||||
// Obfuscated keys
|
||||
#define KIA_MF_KEY_OBF 0xFCBD9AACC4F81D8FULL
|
||||
#define KIA_V6_KEYSTORE_A_OBF 0x37CE21F8C9F862A8ULL
|
||||
#define KIA_V6_KEYSTORE_B_OBF 0x3FC629F0C1F06AA0ULL
|
||||
extern uint64_t kia_mf_key;
|
||||
extern uint64_t kia_v6_a_key;
|
||||
extern uint64_t kia_v6_b_key;
|
||||
|
||||
static inline uint64_t get_kia_mf_key(void)
|
||||
{
|
||||
volatile uint64_t mask = KEY_OBFUSCATION_MASK;
|
||||
return KIA_MF_KEY_OBF ^ mask;
|
||||
}
|
||||
uint64_t get_kia_mf_key();
|
||||
|
||||
static inline uint64_t get_kia_v6_keystore_a(void)
|
||||
{
|
||||
volatile uint64_t mask = KEY_OBFUSCATION_MASK;
|
||||
return KIA_V6_KEYSTORE_A_OBF ^ mask;
|
||||
}
|
||||
uint64_t get_kia_v6_keystore_a();
|
||||
|
||||
static inline uint64_t get_kia_v6_keystore_b(void)
|
||||
{
|
||||
volatile uint64_t mask = KEY_OBFUSCATION_MASK;
|
||||
return KIA_V6_KEYSTORE_B_OBF ^ mask;
|
||||
}
|
||||
uint64_t get_kia_v6_keystore_b();
|
||||
|
||||
void protopirate_keys_load(SubGhzEnvironment* environment);
|
||||
|
||||
Reference in New Issue
Block a user