My task is to get sha512 from user input. How to get hash in C++? I can only use openssl, not crypto++. Honestly, I did not find a clear explanation and code examples on how to apply the same openssl in practice. If sha512 cannot be obtained on openssl, then at least sha384 or sha256, no less!. I ask for a code example with obtaining a hash. The OS used is Linux.

And what, Google did not help?

Alexey Ten2022-02-10 04:36:13

xs, I did not find a clear explanation.

RandomDice 7792022-02-10 04:36:13

I tried an example from here: cyberforum.ru/cpp-beginners/thread2178916.html -the linker is swearing. From your first link -the same. ld.lld: error: undefined symbol: EVP_sha512 >>>referenced by test.c >>>/data/data/com.termux/files/home/tmp/test-d8024e.o:(main) ld.lld: error : undefined symbol: HMAC >>>referenced by test.c >>>/data/data/com.termux/files/home/tmp/test-d8024e.o:(main) clang-13: error: linker command failed with exit code 1 (use -v to see invocation)

RandomDice 7792022-02-10 04:36:13

Ah, bl, I should have added -lcrypto...

RandomDice 7792022-02-10 04:36:13