Cathedrow / Cryptosuite

Cryptographic suite for Arduino (SHA, HMAC-SHA)
318 stars 148 forks source link

invalid conversion #15

Open itroublee opened 8 years ago

itroublee commented 8 years ago

I am using Arduino with ATMEGA 328 and the IDE is version 16.7 installed on Windows 10. tried to run the example in the documentation. Just to create a HMAC256. I tried to verify the code in the IDE, I get this error which I do not know how to fix. Can you help.

invalid conversion from 'const char_' to 'const uint8t {aka const unsigned char*}' [-fpermissive]

The Code is:

include "sha256.h"

void setup() { // put your setup code here, to run once: uint8_t hash; //static const char hash[450]={}; //const char hash; hash={}; Sha256.initHmac("hash key",8); // key, and length of key in bytes Sha256.print("This is a message to hash"); hash = Sha256.resultHmac(); //Serial.print(hash,HEX); }

void loop() { // put your main code here, to run repeatedly:

}

samyxdev commented 8 years ago

Maybe late but here is the list of changes to avoid the "invalid conversion" error (you can modify the sha256 files if you just use this sha type): https://github.com/Cathedrow/Cryptosuite/pull/16/commits/0ee3a5bb65582503c19a2a06fe0c80e1883cdf09