Is there a standard library or commonly used library that can be used for calculating SHA-512 hashes on Linux?
I'm looking for a C or C++ library.
Have you checked OpenSSL. I myself have not used it but documentation says it supports it.
Here is list of few more implementations.
Example code
md = EVP_get_digestbyname("sha512");
EVP_MD_CTX_init(&mdctx);
EVP_DigestInit_ex(&mdctx, md, NULL);
EVP_DigestUpdate(&mdctx, mess1, strlen(mess1));
EVP_DigestUpdate(&mdctx, mess2, strlen(mess2));
EVP_DigestFinal_ex(&mdctx, md_value, &md_len);
EVP_MD_CTX_cleanup(&mdctx);