]> wimlib.net Git - wimlib/commit
SHA-1 rework
authorEric Biggers <ebiggers3@gmail.com>
Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 18 Mar 2023 07:17:54 +0000 (00:17 -0700)
commitf73332717baf4ab155b57f64ec9dbcd344d7f0c1
tree59c9beb628a2bda3641c2580d94d0cdad22b4164
parent9ba9f3ee7bf1b0e6b211425a6c495f5dddf8c2d0
SHA-1 rework

First, add new SHA-1 implementations that use the x86 and ARM SHA-1
intrinsics, so that these can be taken advantage of in Windows builds.

Second, replace sha1-ssse3.asm with an easier-to-maintain implementation
using intrinsics, and build a copy of it with AVX+BMI2 enabled.

Finally, now that better SHA-1 implementations are included, support for
OpenSSL's SHA-1 is no longer very useful, so remove it.

I considered going in the other direction: removing all SHA-1 code and
relying completely on external libraries.  Some issues with that are:

- Statically linking OpenSSL into libwim.dll on Windows increases the
  binary size by over 4x, even when using "no-autoalginit".

- OpenSSL has deprecated its easy-to-use SHA-1 API in favor of the EVP
  API, which is harder to use (everything can fail) and slower.

- Windows CryptoAPI is Windows-only (duh) and also has a complex, slow
  API where every function can fail, so that's not great either.

- SHA-1 is considered insecure these days, so it may be unwise to count
  on its continued support in crypto libraries into the future.

So, let's just do it ourselves...
12 files changed:
Makefile.am
README
README.WINDOWS
build-aux/nasm_lt.sh [deleted file]
configure.ac
include/wimlib/sha1.h
m4/nasm.m4 [deleted file]
src/integrity.c
src/resource.c
src/sha1-ssse3.asm [deleted file]
src/sha1.c
tools/make-windows-release