Index  Comments

As with Common Lisp and APL, I continue from my SHA1 implementation in Ada, exemplifying my planning for a comprehensive SHA library. Its specification is one hundred and twenty-seven lines, with body of three hundred and thirty-eight lines, making it that largest Ada program I've written, as of now.

This program is licensed under the GNU Affero General Public License version three.

As with the SHA1, this package is expected to be used primarily without being USEd; its names permit this approach as the best, as only the package name itself betrays which SHA is implemented therein.

Unlike the SHA1, the Pad procedure only operates in units of the array itself, but there are several array types to allow the desired message granularity, Bit_Array, Octet_Array, and Word_Array. Those Status and Digest types represent the intermediate and final SHA state; there are three varieties of each Hash and Pad for the different array types; Hash has a full and function or procedure blockhash varieties, for nine in sum. The message length is Natural, as there's no good reason to introduce a failure case. This library lacks exceptions entirely, as it's intended to contain no failure cases.

The parameter names are entirely consistent, sans with Pad; those message arrays are Data, Status is State, Digest is Datum. The reason Pad deviates is to make it more easily understood. I suggest to read the documentation for the SHA1 library, as it necessarily contains some history of this design.

This library has been reviewed, however I wouldn't yet stake my life on it and so this is a warning.

Here is the package specification, the package body, the documentation, and the license.