HomePhabricator

sha1: use the real SHA-1 algorithm

Authored by simpkins.

Description

sha1: use the real SHA-1 algorithm

Summary:
The sha1collisiondetection library by default performs its own "safe-hash"
algorithm, which is not actually the same as the normal SHA-1 algorithm.
For most inputs the output will be the actual SHA-1 hash, but if the input
happens to contain one of several known SHA-1 disturbance vectors this code
returns an alternate "safe-hash" output instead.

This updates the code to explicitly disable "safe-hash" mode and collision
detection, so that we always get actual SHA-1 hashes.

Test Plan: Ran the unit tests.

Reviewers: #fbhgext, ryanmce

Reviewed By: #fbhgext, ryanmce

Differential Revision: https://phab.mercurial-scm.org/D284

Details

Committed
simpkinsAug 22 2017, 10:09 PM
Reviewer
Restricted Project
Differential Revision
D284: sha1: use the real SHA-1 algorithm
Parents
rFBHGXd4620a00a087: sha1: update to the stable-v1.0.3 release of sha1collisiondetection
Branches
Unknown
Tags
Unknown