EVP MD

Easy, nothing more to say.

Sample code:

    const EVP_MD *md = EVP_sha1();

    EVP_MD_CTX ctx;

    unsigned char md_buf[EVP_MAX_MD_SIZE];

    unsigned int mdLen = 0;

 

    EVP_MD_CTX_init(&ctx);

 

    if (!EVP_DigestInit_ex(&ctx,md, NULL))

       return 0;

    EVP_DigestUpdate(&ctx,data,datal);

    EVP_DigestFinal_ex(&ctx,&(md_buf[0]),&mds);

 

    EVP_MD_CTX_cleanup(&ctx);

你可能感兴趣的:(null)