Hi Pietro
I checked in the uTasker project (supporting SW, mmCAN and LTC SHA256):
static const ALIGNED_BUFFER text = { 0,{0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, 0x6b, 0x20, 0x62, 0x72, 0x6f,
0x77, 0x6e, 0x20, 0x66, 0x6f, 0x78, 0x20, 0x6a, 0x75, 0x6d, 0x70, 0x73, 0x20,
0x6f, 0x76, 0x65, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6c, 0x61, 0x7a, 0x79,
0x20, 0x64, 0x6f, 0x67, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x58} };
int i;
fnSHA256(text.ucData, recovered.ucData, 64, SHA_START_CALCULATE_TERMINATE);
for (i = 0; i < 32; i++) {
fnDebugHex(recovered.ucData[i], (WITH_SPACE | sizeof(unsigned char) | WITH_LEADIN));
}
The output it gives is:
0xd4 0xb8 0x52 0x7d 0x7a 0x67 0x3b 0x09 0x6b 0xa1 0x9a 0xab 0xfb 0x45 0x8c 0x35 0x7a 0x43 0xf0 0x08 0xd2 0x14 0xaa 0xc4 0x13 0xee 0x18 0xcf 0x29 0x48 0x5f 0xe2
which matches with the one from your link.
1. It looks like you are displaying the result in decimal form - try displaying in hex instead.
2. Also ensure that you are displaying as a string of binary values rather than risking little-/big endian confusion.
3. If using mmCAU ensure that your buffers are long word aligned since the crypto accelerators tend to require this.
Regards
Mark
Complete Kinetis solutions, training and support: http://www.utasker.com/kinetis.html