Skip to content

Commit 0534372

Browse files
committed
Adding 508 check
1 parent bca4e13 commit 0534372

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

examples/ECCX08HMAC/ECCX08HMAC.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ byte data[] = {
2222
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
2323
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
2424
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
25-
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10
25+
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
26+
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
27+
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
2628
};
27-
int dataLength = 56;
29+
int dataLength = 72;
2830

2931
void setup() {
3032
Serial.begin(115200);

src/ECCX08.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ int ECCX08Class::lock()
443443

444444
int ECCX08Class::beginHMAC(uint16_t keySlot)
445445
{
446+
// HMAC implementation is only for ATECC608
447+
long ver = version() & 0x0F00000;
448+
if (ver != 0x0600000) {
449+
return 0;
450+
}
451+
446452
uint8_t status;
447453

448454
if (!wakeup()) {

0 commit comments

Comments
 (0)