<div dir="ltr"><div>Hello- here is a patch that provides these hash functions using built-in routines instead of relying on the OpenSSL library.</div><div><br></div><div>sha224sum</div><div>sha256sum</div><div>sha384sum</div><div>sha512sum</div><div><br></div><div>Regarding the license, this is based on the <a href="https://en.wikipedia.org/wiki/SHA-2">wikipedia page for SHA-2</a>, and doesn't use any existing code. The example <a href="https://csrc.nist.gov/projects/cryptographic-standards-and-guidelines/example-values">intermediate calculations from the NIST</a> were helpful in debugging.<br></div><div><br></div><div>Comments and suggestions are welcome. Here are a few thoughts and questions for the list:</div><div><br></div><div>Tests. Do I need to add some? Please point me to an example.<br></div><div><br></div><div>How to deal with endianness? How should I test the behavior of a big-endian system when developing on a little-endian system?</div><div><br></div><div>I changed the data types to be explicitly sized (eg. uint32_t instead of int). Or is this already taken care of as part of the portability functions?<br></div><div><br></div><div>SHA512 (and SHA384) are a bit tricky. I couldn't figure out how to calculate the constants to the full 64-bit precision needed. Let me know if there are data types >64bit and corresponding math functions (cube root and floor) that are possible.</div><div><br></div><div>Dan<br></div></div>