keygen.h 682 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * (c) 2015-2017 Marcos Del Sol Vives
  3. *
  4. * SPDX-License-Identifier: MIT
  5. */
  6. #ifndef HAVE_NFC3D_KEYGEN_H
  7. #define HAVE_NFC3D_KEYGEN_H
  8. #include <stdint.h>
  9. #include <stdbool.h>
  10. #define NFC3D_KEYGEN_SEED_SIZE 64
  11. #pragma pack(1)
  12. typedef struct {
  13. uint8_t hmacKey[16];
  14. char typeString[14];
  15. uint8_t rfu;
  16. uint8_t magicBytesSize;
  17. uint8_t magicBytes[16];
  18. uint8_t xorPad[32];
  19. } nfc3d_keygen_masterkeys;
  20. typedef struct {
  21. const uint8_t aesKey[16];
  22. const uint8_t aesIV[16];
  23. const uint8_t hmacKey[16];
  24. } nfc3d_keygen_derivedkeys;
  25. #pragma pack()
  26. void nfc3d_keygen(const nfc3d_keygen_masterkeys * baseKeys, const uint8_t * baseSeed, nfc3d_keygen_derivedkeys * derivedKeys);
  27. #endif