<div>I have a Racket program that uses libcrypto through FFI bindings to compute digests. It's wrong because it returns different answers than <span style="font-family: menlo, consolas, courier new, monospace, sans-serif;">`openssl dgst`,</span><span style="font-family: arial, sans-serif;"> regardless of hash algorithm.</span><br></div><div><br></div><div><span style="font-family: arial, sans-serif;">The code is here: </span><a href="https://github.com/zyrolasting/xiden/blob/libcrypto/openssl.rkt#L76">https://github.com/zyrolasting/xiden/blob/libcrypto/openssl.rkt#L76</a> <br></div><div>It is based on the example in: <a href="https://wiki.openssl.org/index.php/EVP_Message_Digests">https://wiki.openssl.org/index.php/EVP_Message_Digests</a>.<span style="font-family: arial, sans-serif;"></span><br></div><div><br></div><div>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.<br></div><div><br></div><div>Let me know if there is any other context I can provide.<br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user"><div><br></div><div><i>~slg</i><br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div>