We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The ATECC508A ( ATECC608A ) chip support ECDH but I can't find support for this in the library. Can you add it, please?
The text was updated successfully, but these errors were encountered:
Hi @monsieur7, In the ECCX08.h you can add to the public functions:
int ecdh(const byte publicKey[], int slot, byte share[]);
And to ECCX08.cpp you can add this:
int ECCX08Class::ecdh(const byte publicKey[], int slot, byte share[]) { if (!wakeup()) { return 0; } if (!sendCommand(0x43, 0x0C, slot, publicKey, 64)) { return 0; } delay(115); if (!receiveResponse(share, 32)) { return 0; } delay(1); idle(); return 1; }
In the main you can call like this:
uint8_t share[32]; ECCX08.ecdh(pubkeyCipher, 2, share); if (res == 0) { Serial.println("[ecdh] Not Valid"); Serial.println(); } else { Serial.println("[ecdh] Valid"); print_array(share, 32); Serial.println(); }
void print_array(uint8_t *array, int arraySize) { char buffer[3]; for (int i = 0; i < arraySize; i++) { sprintf(buffer, "%02x", array[i]); Serial.print(buffer); } Serial.println(""); }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The ATECC508A ( ATECC608A ) chip support ECDH but I can't find support for this in the library. Can you add it, please?
The text was updated successfully, but these errors were encountered: