test-libcrypto.c 325 B

123456789101112131415161718
  1. #include <openssl/sha.h>
  2. #include <openssl/md5.h>
  3. int main(void)
  4. {
  5. MD5_CTX context;
  6. unsigned char md[MD5_DIGEST_LENGTH + SHA_DIGEST_LENGTH];
  7. unsigned char dat[] = "12345";
  8. MD5_Init(&context);
  9. MD5_Update(&context, &dat[0], sizeof(dat));
  10. MD5_Final(&md[0], &context);
  11. SHA1(&dat[0], sizeof(dat), &md[0]);
  12. return 0;
  13. }