Removing difference between CLI and FFI use for computing a message digest

Sage Gerard sage at sagegerard.com
Tue Sep 15 21:48:32 UTC 2020


I have a Racket program that uses libcrypto through FFI bindings to compute digests. It's wrong because it returns different answers than `openssl dgst`, regardless of hash algorithm.

The code is here: https://github.com/zyrolasting/xiden/blob/libcrypto/openssl.rkt#L76
It is based on the example in: https://wiki.openssl.org/index.php/EVP_Message_Digests.

I'm not expecting anyone to run this program or review Racket code in detail. The links are just there for context. I just want to know if there are common C-level mistakes libcrypto users make that would make their digests disagree with the CLI. As far as I can tell, I replicated the example on wiki.openssl.org well enough to deterministically compute a digest with any byte string.

Let me know if there is any other context I can provide.

~slg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20200915/7156dd36/attachment.html>


More information about the openssl-users mailing list