aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md45
-rw-r--r--license.txt20
2 files changed, 52 insertions, 13 deletions
diff --git a/README.md b/README.md
index ce217ec..3bbfd8e 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,37 @@
-My C11 SHA256 implementation.
+Self-contained C11 SHA-2 implementation.
+
+Includes implementations of the following:
+* SHA-224
+* SHA-256
+* SHA-384
+* SHA-512
+* HMAC-SHA-256
+* HMAC-SHA-512
See `tests.c` for usage.
Benchmarks
==========
- > time -p ./sha256 ~/Videos/8x*avi > /dev/null
- rleal 9.39
- user 9.10
- sys 0.29
- > time -p sha256sum ~/Videos/8x*avi > /dev/null
- real 12.04
- user 11.73
- sys 0.31
- > time -p openssl sha256 ~/Videos/8x*avi > /dev/null
- real 6.36
- user 6.01
- sys 0.32
+Benchmarks. Partially unrolled compression makes this implementation
+faster than [coreutils][], but slower than the [assembly-optimized,
+family-specific OpenSSL SHA-2 implementation][openssl-asm-sha].
+
+```
+> time -p ./sha256 ~/Videos/8x*avi > /dev/null
+rleal 9.39
+user 9.10
+sys 0.29
+> time -p sha256sum ~/Videos/8x*avi > /dev/null
+real 12.04
+user 11.73
+sys 0.31
+> time -p openssl sha256 ~/Videos/8x*avi > /dev/null
+real 6.36
+user 6.01
+sys 0.32
+```
+
+ [sha2]: https://en.wikipedia.org/wiki/SHA-2 "Secure Hash Algorithm 2"
+ [c11]: https://en.wikipedia.org/wiki/C11_(C_standard_revision) "C11 standard of the C programming language"
+ [coreutils]: https://www.gnu.org/software/coreutils/ "GNU core utilities"
+ [openssl-asm-sha]: https://github.com/openssl/openssl/tree/master/crypto/sha/asm "assembly-optimized OpenSSL SHA-2 implementation."
diff --git a/license.txt b/license.txt
new file mode 100644
index 0000000..c921bf3
--- /dev/null
+++ b/license.txt
@@ -0,0 +1,20 @@
+Copyright 2019 Paul Duncan
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.