Skip to content

Commit 4562d7c

Browse files
Apply suggestions from code review
Co-authored-by: Dane Walton <[email protected]>
1 parent 7a9b7c2 commit 4562d7c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

examples/ECCX08HMAC/ECCX08HMAC.ino

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
This sketch uses the ECC608 to generate an hmac on some data.
55
Stores key using nonce.
66
7-
Used the Arduino Nano RP2040.
7+
Tested on the Arduino Nano RP2040.
88
99
created 10 October 2022
1010
by Raul Leclair
@@ -28,21 +28,21 @@ byte data[] = {
2828
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
2929
};
3030

31-
int dataLength = 72;
31+
int dataLength = sizeof(data);
3232

3333
void setup() {
3434
Serial.begin(115200);
3535
while (!Serial);
3636

3737
if (!ECCX08.begin()) {
38-
Serial.println("Failed to initialize ECC608 board.");
38+
Serial.println("Failed to initialize ECCX08 board.");
3939
while (1);
4040
}
4141

4242
// Perform nonce
4343
if (!ECCX08.nonce(nonceKey))
4444
{
45-
Serial.println("Failed to do nonce.");
45+
Serial.println("Failed to perform nonce.");
4646
while (1);
4747
}
4848

@@ -64,7 +64,7 @@ void setup() {
6464
}
6565

6666
Serial.println("HMAC Result: ");
67-
for (int i = 0; i<sizeof(resultHMAC); i++) {
67+
for (int i = 0; i < sizeof(resultHMAC); i++) {
6868
char hexChar[2];
6969
sprintf(hexChar, "%02X", resultHMAC[i]);
7070
Serial.print(hexChar);

0 commit comments

Comments
 (0)