Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/cr-marcstevens/sha1collisiondetection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-12-09Merge pull request #63 from timgates42/bugfix_typo_embeddedHEADmasterDan Shumow
docs: fix simple typo, embeded -> embedded
2020-12-06docs: fix simple typo, embeded -> embeddedTim Gates
There is a small typo in lib/sha1.c. Should read `embedded` rather than `embeded`.
2020-01-09Documented SHA-mbles example colliding filescr-marcstevens
2019-05-09Detect endianess on HP-UXMichael Osipov
HP-UX is not properly detected and classified as little endian. Add test macro for HP-UX to make it big endian.
2019-03-12Shorter version of force aligned access.cr-marcstevens
2019-03-12Add compiler option to force aligned access even for Intel CPUs.cr-marcstevens
2018-08-02Merge pull request #45 from avar/aix-big-endian-detectionDan Shumow
Big Endian Detection: Add a whitelist of always BE OSs
2018-08-01Big Endian Detection: Add a whitelist of always BE OSsÆvar Arnfjörð Bjarmason
Hopefully fix the issue with AIX falling through this detection logic and being detected as Little Endian reported on the Git mailing list, see https://public-inbox.org/git/20180729200623.GF945730@genre.crustytoothpaste.net/ Attempt to solve this by extending the existing fallback we have for detecting always Big Endian processors to also detecting always Big Endian OSs. See the public-inbox link in the comment I'm adding for why this should work. I have not tested this myself, since I have no access to AIX. I'll be pointing Michael Felt to the relevant MR so he can test it before this is merged.
2018-02-16sha1c: fix a trivial spelling errorÆvar Arnfjörð Bjarmason
This was originally fixed in git.git's copy of the library in 6412757514 ("Spelling fixes", 2017-06-25).
2017-07-01Merge pull request #37 from avar/fixup-pull-request-34Dan Shumow
Fix endian detection logic for Sparc, little endian BSD etc.
2017-07-01include <sys/types.h> explicitly if __unix__, to make sure macros visibleSODA Noriyuki
the _BIG_ENDIAN macro on NetBSD 9 and Solaris 9 are already visible here. but it's because <sys/types.h> is included indirectly via <stdlib.h> or <memory.h>. that's fragile against changes in those headers. pointed out by obache-san
2017-07-01Big Endian Detection: fix breakage on *BSD & newlibSODA Noriyuki
In 33a694a ("Fix issues with a big endian platform", 2017-05-15) *BSD and newlib was broken because _BIG_ENDIAN is always defined, even on little-endian platforms. To fix this we need to also check the single-underscore version of BIG_ENDIAN & LITTLE_ENDIAN, but only do this if _LITTLE_ENDIAN is also defined. This makes sure that on Solaris we don't break where _BIG_ENDIAN is simply defined, not to any value (but _LITTLE_ENDIAN won't be). See http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/sys/isa_defs.h#397 The https://github.com/cr-marcstevens/sha1collisiondetection/pull/34 pull request has a lot more details on the various issues involved, things that were tried (and not tried) etc. [Commit message & rebase by Ævar]
2017-07-01use #elif to make the nesting level of #if-#endif shallowerSODA Noriyuki
2017-06-28Merge pull request #36 from avar/bigend-detect-solaris-againDan Shumow
Fix BigEndian detection in a more robust way.
2017-06-27Big Endian detection: stop special-casing SolarisÆvar Arnfjörð Bjarmason
As discussed in some detail on the Git mailing list (87tw31jmau.fsf@gmail.com & 87r2y5jkb6.fsf@gmail.com) we don't actually need to check _BIG_ENDIAN at all, because this is covered by the __sparc check earlier on. Thus this makes the whole logic: - Check settings modern (post-2011) GCC & clang export - Check glibc settings exported since forever (1993-ish) - Check a long list of processors known to be big-endian - If any of the above say we're big endian... - ...otherwise little-endian
2017-06-27Rewrite Big Endian detection (again)Ævar Arnfjörð Bjarmason
My recent db62148 ("Correctly detect Big Endian on Solaris", 2017-06-26) was faulty as reported in https://public-inbox.org/git/CAKKM46tHq13XiW5C8sux3=PZ1VHSu_npG8ExfWwcPD7rkZkyRQ@mail.gmail.com/T/#u As far as I can tell most of the logic we have to detect Big Endian already is somewhat cargo-culted, e.g. checking multiple underbar versions of the same define, even though I can find no evidence that e.g. glibc ever exported all those variants. Rewrite it to check an exhaustive list of things we *know* actually exists. It's still possible that this will give us a false positive when it falls through to checking if _BIG_ENDIAN is defined, but at least it'll be on some really obscure platform. While I'm at it, factor out the Intel detection we already do for SHA1DC_ALLOW_UNALIGNED_ACCESS into its own macro so we can use it as a paranoid last resort for "not Big Endian here". This is known to now pass on two different SunOS 11.3 sun4v sparc machines.
2017-06-26Correctly detect Big Endian on SolarisÆvar Arnfjörð Bjarmason
The current code fails to detect Big Endian SPARC on Solaris. The reason for this is that __BYTE_ORDER is defined on Solaris, however because we're trying to avoid a case on Linux where __BYTE_ORDER and __BIG_ENDIAN will always be defined, we're only defining SHA1DC_BIGENDIAN if the two are equivalent. That's not the case on Solaris, and tweaking this code easily lands you in the case where you ruin either Linux or Solaris, because on Linux those two are always defined. There's probably some really tricky middle ground here that would auto-detect this without checking the OS, e.g. I know _BIG_ENDIAN is defined on Solaris, but probably not on Linux (but all versions? who knows?). Liam R. Howlett <Liam.Howlett@oracle.com> reports that this works, and it works for me too on Linux x86_64: diff --git a/sha1dc/sha1.c b/sha1dc/sha1.c index facea1bb5..8c95c64ce 100644 --- a/sha1dc/sha1.c +++ b/sha1dc/sha1.c @@ -38,7 +38,8 @@ #if (defined(_BYTE_ORDER) || defined(__BYTE_ORDER) || defined(__BYTE_ORDER__)) -#if ((defined(_BYTE_ORDER) && (_BYTE_ORDER == _BIG_ENDIAN)) || \ +#if ((defined(__BYTE_ORDER__) && defined(_BIG_ENDIAN)) || \ + (defined(_BYTE_ORDER) && defined(_BIG_ENDIAN) ) || \ (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || \ (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __BIG_ENDIAN__)) ) #define SHA1DC_BIGENDIAN As an aside, this whole thing looks like it may have worked on Solaris before a24eef5 ("rewrote Endianness selection", 2017-05-29), but of course other stuff was broken before then. Let's just take the easy way out here and manually detect Solaris, they're unlikely to add another Big Endian processor any time soon, and then the rest of this logic can stop worrying about being paranoid about Solaris.
2017-05-31Merge pull request #35 from lidl/masterDan Shumow
Fix for endian check on sparc processors.
2017-05-31Fix for operation on sparc processorsKurt Lidl
2017-05-29rewrote Endianness selectioncr-marcstevens
2017-05-20Skip temporary variable for SHA1DC_ALLOW_UNALIGNED_ACCESSÆvar Arnfjörð Bjarmason
This is the feedback I left on pull request #30[1] turned into a patch. 1. https://github.com/cr-marcstevens/sha1collisiondetection/pull/30
2017-05-20Fix misformatted code added in db45d67Ævar Arnfjörð Bjarmason
The entirety of the rest of the file uses 8-width tabs, but this[1] change added 4-width spaces. 1. db45d67 ("Fix performance regression on processors that allow unaligned memory access. (#30)", 2017-05-18)
2017-05-20README: Document the macros you can set to override CPU detectionÆvar Arnfjörð Bjarmason
2017-05-20Allow for defining SHA1DC_FORCE_UNALIGNED_ACCESS externallyÆvar Arnfjörð Bjarmason
This allows for doing -DSHA1DC_FORCE_UNALIGNED_ACCESS on a platform/CPU that's not listed here, since the default is to fall back to aligned access unless except on a whitelist of CPUs. It would be nice e.g. for the git project if someone running on such a platform didn't have to monkeypatch the code, instead they can just provide a -DSHA1DC_FORCE_UNALIGNED_ACCESS argument
2017-05-20Remove trailing spaces in codeÆvar Arnfjörð Bjarmason
This all turns up warnings under "git am". These tend to raise complaints on the git mailing list when they need to apply patches, so give people less of a reason to complain.
2017-05-20.gitignore: ignore lib/.depend/ and other .depend/ directoriesÆvar Arnfjörð Bjarmason
This is a hack so that I can run "make" cleanly in git.git. This is really a wart around there being no easy way to have tracked .gitignore changes to submodules. You can hack e.g. .git/modules/sha1collisiondetection/info/exclude, but that's not under source control, and thus needs to be done by the Makefile. This is an easy workaround that won't show the module dirty everytime "make" is run, while we think about some longer-term fix for this.
2017-05-20.gitignore: add directories that are generated by the MakefileÆvar Arnfjörð Bjarmason
2017-05-18Amend the lib/ code for easier inclusion in other programsÆvar Arnfjörð Bjarmason
This introduces no functional changes, but allows the lib/ code to be used as-is in other programs without patching these files directly, instead those programs can define a few variables to inject their custom code into this code. With these changes the git project can use this code without any modifications to the upstream code. The corresponding git mailing list thread discussing that is at "[PATCH/RFC 0/3] Use sha1collisiondetection as a submodule"[1]. The defines used by git in that patch are: -DSHA1DC_NO_STANDARD_INCLUDES \ -DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \ -DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \ -DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_C="\"../sha1dc_git.c\"" \ -DSHA1DC_CUSTOM_TRAILING_INCLUDE_SHA1_H="\"../sha1dc_git.h\"" \ -DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\"" I.e. all of these except SHA1DC_CUSTOM_TRAILING_INCLUDE_UBC_CHECK_[CH] are used by git. I've merely added those for completeness since other projects doing similar customization might want to use them. The monkeypatches the git project was using previously were: - https://github.com/git/git/commit/45a574eec8 - https://github.com/git/git/commit/c0c20060af - https://github.com/git/git/commit/8325e43b82 The entire paragraph being added to the README file was authored by Dan Shumow. See https://github.com/cr-marcstevens/sha1collisiondetection/pull/31. 1. <20170517113824.31700-1-avarab@gmail.com> (https://public-inbox.org/git/20170517113824.31700-1-avarab@gmail.com/)
2017-05-18Fix performance regression on processors that allow unaligned memory access. ↵Dan Shumow
(#30)
2017-05-15Fix issues with a big endian platformcr-marcstevens
2017-05-08Merge pull request #28 from andreasstieger/errors_stdinMarc Stevens
some IO improvements
2017-05-08support reading from stdinAndreas Stieger
2017-05-08print usage to stderrAndreas Stieger
2017-05-08Print file IO error textsAndreas Stieger
2017-04-10Merge pull request #24 from cr-marcstevens/build/vsMarc Stevens
Build/vs
2017-03-31Turns up warning levels for visual studio build.Dan Shumow
2017-03-30Add visual studio 2015 solution/project files.Dan Shumow
2017-03-27Merge pull request #23 from cr-marcstevens/bigendianstable-v1.0.3Marc Stevens
* Protect against outside definitions of SHA1DC_BIGENDIAN, one can fo…
2017-03-27* Protect against outside definitions of SHA1DC_BIGENDIAN, one can force ↵cr-marcstevens
endianness with either SHA1DC_FORCE_BIGENDIAN or SHA1DC_FORCE_LITTLEENDIAN. * added header guards for lib/sha1.h
2017-03-16Merge pull request #20 from cr-marcstevens/feature/performanceMarc Stevens
Feature/performance
2017-03-16Makefile: bumped library current version due to changed definition of SHA1_CTXcr-marcstevens
2017-03-16Makefile: rewritten endian correctness testcr-marcstevens
2017-03-16Fixed bigendian compile bugcr-marcstevens
2017-03-16Makefile: check target will throw error when output is incorrectcr-marcstevens
2017-03-16sha1.c: fix line endings, made sha1_process staticcr-marcstevens
main.c: use API to determine if collision was found
2017-03-16Replaces commented out code with conditionally compiled code,Dan Shumow
based on preprocessor macros.
2017-03-14Fixed Makefile to correctly rebuild when a header file is modifiedcr-marcstevens
2017-03-13Small bug fix for new code when UBC is disabledcr-marcstevens
2017-03-13* Increase lib patch versioncr-marcstevens
* Re-add lost code from merge
2017-03-10Add BIGENDIAN detection logic.Dan Shumow