SHA-512 source code
SHA-512The source code for the SHA-512 algorithm, also called SHA512. Within PolarSSL this module is referred to as SHA4 or SHA-4 as well. This source code is part of the PolarSSL library and represents the most current version in the trunk of the library.
The full algorithm of SHA-512 is further explained in SHA-512 algorithm (Wikipedia).
In addition to being used for the SHA-512 algorithm, the same code also performs the SHA-384 algorithm. In fact, the SHA-384 hash algorithm is nothing more than the result of the SHA-512 algorithm being cut short.
The code only has a single dependency on config.h in the sha4.c source code file. You can remove this inclusion or just create a simple header file to define one or more of the configuration options that the SHA-512 source code has.
Full documentation on the SHA-512 source code can be found in the API documentation for the SHA-4 module.
You can also download it as part of the latest release of PolarSSL.
Header - sha4.h
The sha4.h header can also be found in the trunk on: sha4.h.
Source - sha4.c
The sha4.c source code can also be found in the trunk on: sha4.c.