P100脱机下载器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
4.7 KiB

4 years ago
  1. #pragma once
  2. #include "string.h"
  3. /*
  4. V1.2:
  5. £
  6. ԿΪ4ֽڡ8ֽʱȡûԶ IDԽԿȷ
  7. MINI-Proѻ V1.20B ̼ʹV1.2
  8. MINIѻ V1.4A2 ̼ʹV1.2
  9. Ӱ
  10. ǰ
  11. (1).MINIѻ˹̼V1.4A2ʹMINIѻõV1.2;
  12. (2).MINI-Proѻ˹̼V1.20BʹMINIѻõV1.2;
  13. (3).ԿΪ4ֽڡ8ֽڵ
  14. (1).ԿΪ 4/8ֽʱ߼ԿԿΪ4/8ֽӰ
  15. V1.1ǰĴͬ
  16. (1).MINI-ProѻѾV1.20B̼ûԻ˵ɰ̼ʹá
  17. (2).MINIѻѾV1.4A2̼ûԻ˵ɰ̼ʹá
  18. Ӱ
  19. (1).ֻҪԿΪ12ֽھӰ
  20. V1.1:
  21. £
  22. MINIѻV1,3A5̼ʹV1.1V1.1޸V1.0
  23. UID_Encryption_Key_Check(),UID_Encryption_Key_Calculate()ʹô
  24. ģʽпֵܳڴԽ
  25. Ӱ
  26. ǰ
  27. (1).MINIѻĹ̼V1.3A5ʹMINIѻõV1.1;
  28. (2).ǰ ʹV1.3A4֮ǰ̼MINIѻ ΪģʽûʹõV1.0
  29. (1).ʹV1.3A5̼MINIѻUIDԶܹܣȻ¼V1.0û
  30. V1.1ĴģʽԿV1.0Կһ£˻оƬлֻԿ֤ͨ
  31. (1).ûеV1.0ͬµV1.1
  32. Ӱ
  33. (1).ǰʹ Сģʽ õûƷܵV1.1ԼMINIѻ̼µӰ
  34. (2).ѾʹV1.0IJƷʹIAPʽ򲻻ܵӰ
  35. (3).ѾʹV1.0IJƷʹMINIѻƷ UIDԶܹ¸ԿܵӰ
  36. ʹѻƷĻû˵UIDԶܴΪV1.1ͬʱUIDԶ¸Կ
  37. (4)MINI-Proѻװ̼ʹõV1.1ĴӰ
  38. V1.0
  39. MINIѻV1.3A4̼֮ǰĹ̼оʹV1.0Ĵ
  40. */
  41. typedef enum
  42. {
  43. LENGTH_4 = 4,
  44. LENGTH_8 = 8,
  45. LENGTH_12 = 12
  46. }eKeyLengthType;
  47. typedef enum
  48. {
  49. LITTLE_ENDIA = 0,
  50. BIG_ENDIA
  51. }eEndiaType;
  52. typedef enum
  53. {
  54. ALGORITHM_0 = 0,
  55. ALGORITHM_1,
  56. ALGORITHM_2,
  57. ALGORITHM_3,
  58. ALGORITHM_4
  59. }eAlgorithmType;
  60. /****************** �������º���������Կ��֤ ******************/
  61. /*
  62. pKey, ָԿĴָԿʼַ
  63. pUID, ָUIDĴָ UIDʼַ
  64. pCustomID, ָûԶIDָ
  65. keyLength, Կֽڳȣѡοö eKeyLengthTypeĶ
  66. endiaType, Сѡ񣬿ѡοö eEndiaTypeĶ
  67. AlgorithmNumUIDԿѡ񣬿ѡοö eAlgorithmTypeĶ
  68. أ
  69. Կ֤Ľ
  70. 0ȷ
  71. 1
  72. */
  73. char UID_Encryption_Key_Check(void *pKey, //[IN]
  74. void *pUID, //[IN]
  75. void *pCustomID, //[IN]
  76. eKeyLengthType keyLength, //[IN]
  77. eEndiaType endiaType, //[IN]
  78. eAlgorithmType AlgorithmNum); //[IN]
  79. /****************** �������º���������Կ���� ******************/
  80. /*
  81. pUID, ָUIDĴָûӦԤȷã UIDʼַ
  82. pCustomID, ָûԶIDָ
  83. keyLength, Կֽڳȣѡοö eKeyLengthTypeĶ
  84. endiaType, Сѡ񣬿ѡοö eEndiaTypeĶ
  85. AlgorithmNumUIDԿѡ񣬿ѡοö eAlgorithmTypeĶ
  86. pKey, ָһڴڴżԿ
  87. أ
  88. Կ֤Ľ
  89. 0ȷ
  90. 1
  91. */
  92. void UID_Encryption_Key_Calculate(void *pKey, //[OUT]
  93. void *pUID, //[IN]
  94. void *pCustomID, //[IN]
  95. eKeyLengthType keyLength, //[IN]
  96. eEndiaType endiaType, //[IN]
  97. eAlgorithmType AlgorithmNum);//[IN]