EDIT: My code snippet so far is as follows, getting an error "error: no matching function for call to 'Hash::update(StringSumHelper&, int&)' hash->update(input + posn, len); "but it doesn't output the correct hash..
#include <Crypto.h>
#include <SHA256.h>
#include <string.h>
#define OUTPUT_MAXHASH_SIZE 32
#define BLOCK_SIZE 64
char hex[256];
char *hashvalue;
SHA256 Stringsha256;
byte hbuffer[128];
char *btoh(String&char input*dest, uint8_t *src, int len) {
char output[OUTPUT_MAX];*d = dest;
char*while( datalen-- =) input.c_strsprintf();d, "%02x",
(unsigned char)*src++), d += 2;
Hashreturn *hash;dest;
}
char* inth(Hash posn*hash, len;char* hashvalue)
{
int size_t size = input.lengthsizeof(&hashvalue);
int size_t posn, len;
size_t inc = input.lengthsizeof(&hashvalue);
uint8_t value[HASH_SIZE];
hash->reset();
for (posn = 0; posn < size; posn += inc) {
len = size - posn;
if (len > inc)
len = inc;
hash->update(input&hashvalue + posn, len);
}
hash->finalize(value, sizeof(value));
return(btoh(hex, Stringvalue, 32));
}
void setup(output)
{
Serial.begin(115200);
bool tmp;
char *testvalue = "abc";
Serial.println(h(&sha256,*testvalue));
}
void loop()
{
}