1

I am trying to use LibTomCrypt library with Contiki OS but it's not working at all. I get the error: fatal: Not a valid object name HEAD. I have used the following code for computing hash in my client file.

 unsigned char* hashSHA1(const char* input, unsigned long inputSize) {
    //Initial
    unsigned char* hashResult = (unsigned char*)malloc(sha1_desc.hashsize);
    //Initialize a state variable for the hash
    hash_state md;
    sha1_init(&md);
    //Process the text - remember you can call process() multiple times
    sha1_process(&md, (const unsigned char*) input, inputSize);
    //Finish the hash calculation
    sha1_done(&md, hashResult);
    // Return the result
    return hashResult;
}

and then I call it in send_packet(). I have added the header file

`#include <tomcrypt.h>` 

Now in Makefile, I am not sure how shall I add a path. I have checked a few possible ways, for instance, Contiki mote type creation error when trying to use libtomcrypt library (rsa public key generation) and I have added the following lines :

    PROJECT_SOURCEFILES += sha1.c
    MODULES += ./libtomcrypt-develop
    PROJECT_LIBRARIES+= $(CONTIKI)/libtomcrypt-develop/libtomcrypt.a

(here libtomcrypt-develop is the name of the folder containing LibTomCrypt library) According to my understanding, I guess there is something wrong in Makefile. Can someone please identify the problem in Makefile?

matesio
  • 1,584
  • 17
  • 31
user3582228
  • 181
  • 2
  • 14

0 Answers0