Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HMAC and nonce functionality for ATECC608 #45

Merged
merged 8 commits into from
Dec 1, 2022

Conversation

RLeclair
Copy link
Contributor

Addressing issue #42

Adding nonce functionality

  • Exposing challenge private function which does nonce

Adding HMAC functionality

  • Did not implement for 508
  • beginHMAC: SHA opcode, uses HMAC begin mode.
  • updateHMAC: implements while loop for processing data of different lengths.
  • endHMAC: in 608 does not differ from endSHA256.

Adding HMAC and nonce example

  • Simple example to do an HMAC 256 operation using nonce and HMAC (0xFFFF is keySlot for TempKey)

@CLAassistant
Copy link

CLAassistant commented Oct 21, 2022

CLA assistant check
All committers have signed the CLA.

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Oct 21, 2022
@github-actions
Copy link

Memory usage change @ 7a9b7c2

Board flash % RAM for global variables %
arduino:mbed:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ECCX08HMAC
flash
% examples/ECCX08HMAC
RAM for global variables
% examples/ECCX08RandomNumber
flash
% examples/ECCX08RandomNumber
RAM for global variables
% examples/Tools/ECCX08CSR
flash
% examples/Tools/ECCX08CSR
RAM for global variables
% examples/Tools/ECCX08JWSPublicKey
flash
% examples/Tools/ECCX08JWSPublicKey
RAM for global variables
% examples/Tools/ECCX08SelfSignedCert
flash
% examples/Tools/ECCX08SelfSignedCert
RAM for global variables
%
arduino:mbed:envie_m7 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:megaavr:uno2018 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrgsm1400 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrnb1500 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrvidor4000 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1300 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1310 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/ECCX08HMAC<br>flash,%,examples/ECCX08HMAC<br>RAM for global variables,%,examples/ECCX08RandomNumber<br>flash,%,examples/ECCX08RandomNumber<br>RAM for global variables,%,examples/Tools/ECCX08CSR<br>flash,%,examples/Tools/ECCX08CSR<br>RAM for global variables,%,examples/Tools/ECCX08JWSPublicKey<br>flash,%,examples/Tools/ECCX08JWSPublicKey<br>RAM for global variables,%,examples/Tools/ECCX08SelfSignedCert<br>flash,%,examples/Tools/ECCX08SelfSignedCert<br>RAM for global variables,%
arduino:mbed:envie_m7,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:megaavr:uno2018,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrgsm1400,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrnb1500,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrvidor4000,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1300,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1310,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwifi1010,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@per1234
Copy link
Contributor

per1234 commented Nov 3, 2022

Hi @RLeclair. Thanks so much for your pull request!

It looks like you have not yet signed the contributor license agreement, which we require of all contributors. Would you mind taking care of that so it doesn't act as a blocker on merging this PR?

It can be signed here:

https://cla-assistant.io/arduino-libraries/ArduinoECCX08?pullRequest=45

Please let me know if you have any questions or concerns.

@per1234 per1234 added the status: blocked Progress on this prevented by an external cause label Nov 3, 2022
@RLeclair
Copy link
Contributor Author

Hi @per1234 just signed the contributor license agreement, apologies for the delay!

@per1234 per1234 removed the status: blocked Progress on this prevented by an external cause label Nov 16, 2022
@RLeclair
Copy link
Contributor Author

Hi @per1234, is there anything else needed for merging this PR? Let me know, thanks!

examples/ECCX08HMAC/ECCX08HMAC.ino Outdated Show resolved Hide resolved
examples/ECCX08HMAC/ECCX08HMAC.ino Outdated Show resolved Hide resolved
examples/ECCX08HMAC/ECCX08HMAC.ino Outdated Show resolved Hide resolved
examples/ECCX08HMAC/ECCX08HMAC.ino Outdated Show resolved Hide resolved
examples/ECCX08HMAC/ECCX08HMAC.ino Outdated Show resolved Hide resolved
examples/ECCX08HMAC/ECCX08HMAC.ino Outdated Show resolved Hide resolved
src/ECCX08.cpp Outdated Show resolved Hide resolved
src/ECCX08.cpp Show resolved Hide resolved
src/ECCX08.cpp Show resolved Hide resolved
src/ECCX08.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link

Memory usage change @ 4562d7c

Board flash % RAM for global variables %
arduino:mbed:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ECCX08HMAC
flash
% examples/ECCX08HMAC
RAM for global variables
% examples/ECCX08RandomNumber
flash
% examples/ECCX08RandomNumber
RAM for global variables
% examples/Tools/ECCX08CSR
flash
% examples/Tools/ECCX08CSR
RAM for global variables
% examples/Tools/ECCX08JWSPublicKey
flash
% examples/Tools/ECCX08JWSPublicKey
RAM for global variables
% examples/Tools/ECCX08SelfSignedCert
flash
% examples/Tools/ECCX08SelfSignedCert
RAM for global variables
%
arduino:mbed:envie_m7 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:megaavr:uno2018 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrgsm1400 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrnb1500 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrvidor4000 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1300 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1310 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/ECCX08HMAC<br>flash,%,examples/ECCX08HMAC<br>RAM for global variables,%,examples/ECCX08RandomNumber<br>flash,%,examples/ECCX08RandomNumber<br>RAM for global variables,%,examples/Tools/ECCX08CSR<br>flash,%,examples/Tools/ECCX08CSR<br>RAM for global variables,%,examples/Tools/ECCX08JWSPublicKey<br>flash,%,examples/Tools/ECCX08JWSPublicKey<br>RAM for global variables,%,examples/Tools/ECCX08SelfSignedCert<br>flash,%,examples/Tools/ECCX08SelfSignedCert<br>RAM for global variables,%
arduino:mbed:envie_m7,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:megaavr:uno2018,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrgsm1400,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrnb1500,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrvidor4000,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1300,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1310,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwifi1010,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@github-actions
Copy link

Memory usage change @ eb93d9d

Board flash % RAM for global variables %
arduino:mbed:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:megaavr:uno2018 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrvidor4000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ECCX08HMAC
flash
% examples/ECCX08HMAC
RAM for global variables
% examples/ECCX08RandomNumber
flash
% examples/ECCX08RandomNumber
RAM for global variables
% examples/Tools/ECCX08CSR
flash
% examples/Tools/ECCX08CSR
RAM for global variables
% examples/Tools/ECCX08JWSPublicKey
flash
% examples/Tools/ECCX08JWSPublicKey
RAM for global variables
% examples/Tools/ECCX08SelfSignedCert
flash
% examples/Tools/ECCX08SelfSignedCert
RAM for global variables
%
arduino:mbed:envie_m7 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:mbed_nano:nanorp2040connect N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:megaavr:uno2018 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrgsm1400 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrnb1500 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrvidor4000 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1300 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwan1310 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:nano_33_iot N/A N/A N/A N/A 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
Click for full report CSV
Board,examples/ECCX08HMAC<br>flash,%,examples/ECCX08HMAC<br>RAM for global variables,%,examples/ECCX08RandomNumber<br>flash,%,examples/ECCX08RandomNumber<br>RAM for global variables,%,examples/Tools/ECCX08CSR<br>flash,%,examples/Tools/ECCX08CSR<br>RAM for global variables,%,examples/Tools/ECCX08JWSPublicKey<br>flash,%,examples/Tools/ECCX08JWSPublicKey<br>RAM for global variables,%,examples/Tools/ECCX08SelfSignedCert<br>flash,%,examples/Tools/ECCX08SelfSignedCert<br>RAM for global variables,%
arduino:mbed:envie_m7,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:mbed_nano:nanorp2040connect,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:megaavr:uno2018,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrgsm1400,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrnb1500,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrvidor4000,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1300,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwan1310,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:mkrwifi1010,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0
arduino:samd:nano_33_iot,N/A,N/A,N/A,N/A,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0

@RLeclair
Copy link
Contributor Author

Hi @facchinm, thanks for reviewing the PR, wanted to know if there is anything left needed to merge this PR?

@facchinm
Copy link
Contributor

facchinm commented Dec 1, 2022

LGTM! Squashing and merging!

@facchinm facchinm merged commit 82ec8c1 into arduino-libraries:master Dec 1, 2022
@per1234 per1234 mentioned this pull request Dec 1, 2022
@RLeclair
Copy link
Contributor Author

RLeclair commented Dec 1, 2022

@facchinm I saw that the latest release was in March, is there a planned release date for 1.3.7? Thanks for all the help!

@facchinm
Copy link
Contributor

facchinm commented Dec 2, 2022

Releasing now 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants