intiial commit
Dependencies: MAX8614X USBDevice max32630hsp_test
Revision 15:2616528b4007, committed 2018-08-16
- Comitter:
- phonemacro
- Date:
- Thu Aug 16 21:35:56 2018 +0000
- Parent:
- 14:1939758a03cf
- Child:
- 16:d0f8cf9f160d
- Commit message:
- six challenges successful
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Aug 16 21:19:32 2018 +0000
+++ b/main.cpp Thu Aug 16 21:35:56 2018 +0000
@@ -60,6 +60,13 @@
int main()
{
#define CHALLENGE_SZ_NO_SECRET 20
+ uint8_t challenge_A[CHALLENGE_SZ_NO_SECRET] = { // 160 bit, no ROM
+ 0x00, 0x00, 0x00, 0x01,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00
+ };
uint8_t challenge_1[CHALLENGE_SZ_NO_SECRET] = { // 160 bit
0x5e, 0x81, 0x35, 0x24,
0x56, 0x63, 0xd6, 0x09,
@@ -83,6 +90,13 @@
0xd6, 0x53, 0x38, 0x0d,
0x2a, 0xd5, 0xdd, 0x6b
};
+ uint8_t challenge_4[CHALLENGE_SZ_NO_SECRET] = { // 160 bit, no ROM
+ 0x4c, 0x3c, 0x0a, 0xca,
+ 0x61, 0x8a, 0xbd, 0xf2,
+ 0x34, 0xd8, 0xb3, 0x41,
+ 0x12, 0x89, 0xf3, 0x78,
+ 0x65, 0xb6, 0x0d, 0xeb
+ };
#define MAC_SZ 32
@@ -99,10 +113,11 @@
// m.readRegister(MAX8614X::MAX8614X_PART_ID_REG, data, 1);
// printf("device id should be 0x24, reg %02X = %02X\r\n", MAX8614X::MAX8614X_PART_ID_REG, data[0]);
+ executeSha256(m, challenge_A, CHALLENGE_SZ_NO_SECRET, 1);
executeSha256(m, challenge_1, CHALLENGE_SZ_NO_SECRET, 1);
-// executeSha256(m, challenge_2, CHALLENGE_SZ_NO_SECRET, 1);
executeSha256(m, challenge_2, CHALLENGE_SZ_NO_SECRET, 0);
executeSha256(m, challenge_3, CHALLENGE_SZ_NO_SECRET, 1);
+ executeSha256(m, challenge_4, CHALLENGE_SZ_NO_SECRET, 0);
//- Compare MAC from MAX86140 wth Host's precalculated MAC.
//- Check PASS or FAIL.
//- Disable SHA_EN bit ( Write 0 to SHA_EN bit).