Rename MySigningDriver* to MySigning*

This commit is contained in:
Henrik Ekblad
2015-03-10 00:07:57 +01:00
parent 7a1cdd06e1
commit 6d0ae813c4
16 changed files with 73 additions and 73 deletions
+40
View File
@@ -0,0 +1,40 @@
/*
ATSHA204 signing backend. The Atmel ATSHA204 offers true random number generation and
HMAC-SHA256 authentication with a readout-protected key.
Created by Patrick "Anticimex" Fallberg <patrick@fallberg.net>
*/
#ifndef MySigningAtsha204_h
#define MySigningAtsha204_h
#include "MyConfig.h"
#include "MySigning.h"
#include "utility/ATSHA204.h"
#include <stdint.h>
#define SIGNING_IDENTIFIER (1)
// The ATSHA204 is capable of generating proper random numbers for nonce
// and can calculate HMAC-SHA256 signatures. This is enterprise-
// level of security and ought to implement the signing needs for anybody.
class MySigningAtsha204 : public MySigning
{
public:
MySigningAtsha204(bool requestSignatures=true, uint8_t atshaPin = MY_ATSHA204_PIN);
bool getNonce(MyMessage &msg);
bool checkTimer(void);
bool putNonce(MyMessage &msg);
bool signMsg(MyMessage &msg);
bool verifyMsg(MyMessage &msg);
private:
atsha204Class atsha204;
unsigned long timestamp;
bool verification_ongoing;
uint8_t current_nonce[NONCE_NUMIN_SIZE_PASSTHROUGH];
uint8_t temp_message[32];
uint8_t rx_buffer[SHA204_RSP_SIZE_MAX];
uint8_t tx_buffer[SHA204_CMD_SIZE_MAX];
bool calculateSignature(MyMessage &msg);
};
#endif