2017-12-12 19:48:09 +00:00
|
|
|
# sha-2
|
2017-12-13 10:12:47 +00:00
|
|
|
|
|
|
|
## Contents
|
|
|
|
|
|
|
|
SHA-2 algorithm implementations.
|
|
|
|
|
2017-12-13 10:14:32 +00:00
|
|
|
At the moment, only SHA-256 is implemented.
|
2017-12-13 10:12:47 +00:00
|
|
|
|
|
|
|
## Design criteria
|
|
|
|
|
|
|
|
- Easy to test, include in any project, compile and link.
|
|
|
|
|
|
|
|
- ANSI C with as little specific C99 as possible (e.g. extended
|
|
|
|
integer types are used, but not bool).
|
|
|
|
|
|
|
|
- Portable. Makes no assumptions on the target system's endianess or
|
|
|
|
word size.
|
|
|
|
|
|
|
|
- The SHA-256 implementation is a straightforward implementation of
|
|
|
|
the algorithm specified on
|
|
|
|
[Wikipedia](https://en.wikipedia.org/wiki/SHA-2). At the moment,
|
2017-12-13 10:18:17 +00:00
|
|
|
no effort at all has been put on optimization.
|
2017-12-13 10:12:47 +00:00
|
|
|
|
2017-12-13 10:29:58 +00:00
|
|
|
## Testing
|
|
|
|
|
|
|
|
Some testing has been performed, that hopefully proves that the
|
|
|
|
implementation is correct. However, no effort has so far been put into
|
|
|
|
testing large sizes of data.
|
|
|
|
|
2017-12-13 10:23:44 +00:00
|
|
|
## Notes
|
|
|
|
|
|
|
|
The Makefile is as minimal as possible. No effort was put into making
|
|
|
|
it general. Its purpose is mainly to ease testing for the developer's
|
|
|
|
host machine. The actual implementation is however extremely easy to
|
|
|
|
include in any project, may it use GNU make or any other build tool.
|
|
|
|
|
2017-12-13 10:12:47 +00:00
|
|
|
## License
|
|
|
|
|
|
|
|
This repository is made available in the public domain. See [LICENSE
|
|
|
|
FILE](LICENSE).
|