Commit Graph

14 Commits

Author SHA1 Message Date
Brad King
a0af10e423 Merge topic 'librhash-left-shift-unsigned'
9e07ffa4 librhash: Avoid signed left-shift overflow in sha256
2016-11-29 08:58:59 -05:00
Brad King
9e07ffa4e4 librhash: Avoid signed left-shift overflow in sha256
Fix `rhash_sha256_final` to use unsigned integers for left shifting to
avoid the possibility of undefined overflow behavior.
2016-11-29 08:30:25 -05:00
Brad King
7a79f7e3c1 librhash: Activate SHA-3 implementation 2016-11-10 15:48:41 -05:00
Brad King
87584b5e9d Merge branch 'upstream-librhash' into add-SHA-3
* upstream-librhash:
  librhash 2016-11-06 (de79828d)
2016-11-10 15:42:32 -05:00
Brad King
d0ff3e701c librhash: Port to KWIML for ABI and integer type information 2016-11-10 08:29:37 -05:00
Brad King
465a85fb46 librhash: Avoid signed left-shift overflow
Fix `rhash_md5_final` to use unsigned integers for left shifting to
avoid the possibility of undefined overflow behavior.
2016-11-10 08:29:36 -05:00
Brad King
fc2cb74fee librhash: Implement bswap_32 as a function even in strict C90 mode
We cannot fall back to the macro implementation because some call sites
may call it with an argument like `*ptr++` that has side effects.
2016-11-10 08:29:36 -05:00
Brad King
0bd333bc2e librhash: Implement bswap_64 even in strict C90 mode 2016-11-10 08:29:36 -05:00
Brad King
7189d62c32 librhash: Use __builtin_bswap{32,64} on Clang 2016-11-10 08:28:57 -05:00
Brad King
af7ebf8ad3 librhash: Install COPYING file with CMake documentation
When we install using the bundled librhash source, notify users of its
license terms.
2016-11-10 08:26:55 -05:00
Brad King
bb01f20e99 librhash: Disable warnings to avoid changing 3rd party code
Add '-w' or equivalent flag on compilers supporting it.
Tell MSVC to use its lowest warning level inside librhash sources.
2016-11-10 08:26:55 -05:00
Brad King
31bb727f3b librhash: Build the library within CMake
Update `ustd.h` to include KWSys Large File Support configuration so
that consistent stream libraries are used (on AIX with XL).

Add a `cm_rhash.h` header to include the CMake-provided copy of the
`rhash.h` header from CMake sources.
2016-11-10 08:26:54 -05:00
Brad King
53048afa8d librhash: Remove source fragments not needed for CMake
We only need a subset of the hash algorithms supported by librhash.
Add preprocessor conditionals to remove source fragments that we do
not need.  Write an alternative algorithm enumeration that matches
the indexing on our reduced array.

Also remove a few fragments outright.
2016-11-10 08:26:54 -05:00
Brad King
5cb1b345d9 Merge branch 'upstream-librhash' into import-librhash
* upstream-librhash:
  librhash 2016-11-01 (d839a1a8)
2016-11-03 13:45:29 -04:00