Printing Message - Libelium Waspmote v15 and Plug & Sense Programming Manual

Waspmote encryption libraries
Table of Contents

Advertisement

Next code shows how to calculate the message digest with
pointer to the buffer where the output is stored, the input message pointer and the length of the input message.
{
char message[] = "Libelium";
HASH.sha(SHA1, hash_message, (uint8_t*)message, strlen(message)*8);
}
{
char message[] = "Libelium";
HASH.sha(SHA384, hash_message, (uint8_t*)message, strlen(message)*8);
}

2.3. Printing Message

Using the hash function
HASH.printMessageDigest()
{
// Write message digest by USB port
HASH.printMessageDigest("SHA-1:", hash_message, 20);
HASH.printMessageDigest("MD5:", hash_message, 16);
}
Example of use may be found in:
http://www.libelium.com/development/waspmote/examples/hash-01-md5
http://www.libelium.com/development/waspmote/examples/hash-02-sha1
. The inputs expected are: the SHA algorithm, the
HASH.sha()
the message digest is written via USB port.
-8-
Integrity
v7.0

Advertisement

Table of Contents
loading

Table of Contents