This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x crypto SHA256

Hi all - New to this but here goes...

I'm on beaglebone black with ti-sdk-am335x-evm-06.00.00.00. I can run the crypto sample app SHA1_test OK, but I made a mod to do SHA256 ( basically first line below ) and it segfaulted ( after printing "q6".

Tried with 10K rnddata as well.

----------------------------------------------------------------------------------------

md = EVP_sha256();  // set SHA1 message digest
 printf("q1\n");
 if (!md)
 {
     printf ("%s Error getting EVP \n", __FUNCTION__);
     return -1;
 }


 EVP_MD_CTX_init(&mdctx);  // initializes digest context mdctx
 EVP_DigestInit_ex(&mdctx, md, e);  //sets up digest context mdctx to use a digest SHA1 

 while ((bytes = fread (mystring, 1, 8192, fp)) != 0)
 {
     printf("q6\n");
        EVP_DigestUpdate(&mdctx, mystring, bytes); // hashes "bytes" of data at "mystring" into the digest context mdctx. This function can be called several times on the same mdctx to hash additional data.
 }

  • Doug,

    I am taking a look at this.    

    For now, passing NULL for the engine in the EVP_DigestInit_ex will succeed in calculating a SHA256 hash using software:

     EVP_DigestInit_ex(mdctx, md, NULL);

    Likely you're after hardware acceleration, so this is not going to be very helpful.  

    I'll have an update at the end of the week.

    Regards,
    Mike