ATSHA204 signing backend

Default SDA pin is A3 for single wire communication.
The pin is selected in MyConfig.h.
I2C variant of ATSHA204 is not supported.

Messages are signed using HMAC-SHA256 where some parts of the
message digest are ATSHA204 specific.
This commit is contained in:
Patrick Fallberg
2015-02-17 23:25:24 +01:00
parent fca0d4b544
commit ce290e280e
5 changed files with 1000 additions and 0 deletions
+19
View File
@@ -17,6 +17,7 @@
// Choose signing backend by enabling one of the following
#define MYSENSORS_SIGNING_DUMMY
//#define MYSENSORS_SIGNING_ATSHA204
// Define a suitable timeout for a signature verification session
// Consider the turnaround from a nonce being generated to a signed message being received
@@ -39,6 +40,24 @@ typedef class MyRFDriverRF69 MyRFDriverClass;
typedef class MySigningDriverDummy MySigningDriverClass;
#endif
#ifdef MYSENSORS_SIGNING_ATSHA204
#ifdef MYSENSORS_SENSOR
#define ATSHA204_PIN 17 //A3
#endif
#ifdef MYSENSORS_SERIAL_GATEWAY
#define ATSHA204_PIN 17 //A3
#endif
#ifdef MYSENSORS_ETHERNET_MQTT_GATEWAY
#define ATSHA204_PIN 17 //A3
#endif
#include "MySigningDriverAtsha204.h"
#define SIGNING_IDENTIFIER (1) // SHA256-based HMAC (ATSHA204 specific)
typedef class MySigningDriverAtsha204 MySigningDriverClass;
#endif
/***
* Enable/Disable debug logging
*/