passy_common.h 913 B

123456789101112131415161718192021222324252627282930
  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. PassyReadDG1 = 0x0101,
  8. PassyReadDG2 = 0x0102,
  9. PassyReadDG3 = 0x0103,
  10. PassyReadDG4 = 0x0104,
  11. PassyReadDG5 = 0x0105,
  12. PassyReadDG6 = 0x0106,
  13. PassyReadDG7 = 0x0107,
  14. PassyReadDG8 = 0x0108,
  15. PassyReadDG9 = 0x0109,
  16. PassyReadDG10 = 0x010A,
  17. PassyReadDG11 = 0x010B,
  18. PassyReadDG12 = 0x010C,
  19. PassyReadDG13 = 0x010D,
  20. PassyReadDG14 = 0x010E,
  21. PassyReadDG15 = 0x010F,
  22. } PassyReadType;
  23. void passy_log_bitbuffer(char* tag, char* prefix, BitBuffer* buffer);
  24. void passy_log_buffer(char* tag, char* prefix, uint8_t* buffer, size_t buffer_len);
  25. void passy_mac(uint8_t* key, uint8_t* data, size_t data_length, uint8_t* mac, bool prepadded);
  26. char passy_checksum(char* str);
  27. int print_struct_callback(const void* buffer, size_t size, void* app_key);