passy_common.h 940 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <mbedtls/des.h>
  3. #include <furi.h>
  4. #include <toolbox/bit_buffer.h>
  5. typedef enum {
  6. PassyReadNone = 0,
  7. PassyReadCOM = 0x011E,
  8. PassyReadDG1 = 0x0101,
  9. PassyReadDG2 = 0x0102,
  10. PassyReadDG3 = 0x0103,
  11. PassyReadDG4 = 0x0104,
  12. PassyReadDG5 = 0x0105,
  13. PassyReadDG6 = 0x0106,
  14. PassyReadDG7 = 0x0107,
  15. PassyReadDG8 = 0x0108,
  16. PassyReadDG9 = 0x0109,
  17. PassyReadDG10 = 0x010A,
  18. PassyReadDG11 = 0x010B,
  19. PassyReadDG12 = 0x010C,
  20. PassyReadDG13 = 0x010D,
  21. PassyReadDG14 = 0x010E,
  22. PassyReadDG15 = 0x010F,
  23. } PassyReadType;
  24. void passy_log_bitbuffer(char* tag, char* prefix, BitBuffer* buffer);
  25. void passy_log_buffer(char* tag, char* prefix, uint8_t* buffer, size_t buffer_len);
  26. void passy_mac(uint8_t* key, uint8_t* data, size_t data_length, uint8_t* mac, bool prepadded);
  27. char passy_checksum(char* str);
  28. int print_struct_callback(const void* buffer, size_t size, void* app_key);