Added SHA command to ATSHA204 backend driver

The SHA command is available in ATSHA204A variants of the chip
and can be used to calculate SHA256 digests of arbitrary data.

This enables us to strengthen the quality of the signatures by
salting signatures with node-specific data and improving the
quality of random data.
This commit is contained in:
Patrick Fallberg
2015-03-16 20:14:22 +01:00
parent cb5e3172bd
commit 4c4c9a8b39
4 changed files with 54 additions and 6 deletions
+2 -1
View File
@@ -31,10 +31,11 @@ private:
unsigned long timestamp;
bool verification_ongoing;
uint8_t current_nonce[NONCE_NUMIN_SIZE_PASSTHROUGH];
uint8_t temp_message[32];
uint8_t temp_message[SHA_MSG_SIZE];
uint8_t rx_buffer[SHA204_RSP_SIZE_MAX];
uint8_t tx_buffer[SHA204_CMD_SIZE_MAX];
bool calculateSignature(MyMessage &msg);
uint8_t* sha256(const uint8_t* data, size_t sz);
};
#endif