CryptoAPI does not offer the possibility to calculate a Hash-based message authentication code (HMAC) with the SHA512 digest algorithm, so I extended the existing code to add that possibility.
Compatibility with the original library was maintained.
Thanks to Ricardo Silva for the original version.