Patch 1639 use Crypto.Hash.SHA256.hashlazy in Darcs.Util.Hash

Title use Crypto.Hash.SHA256.hashlazy in Darcs.Util.Hash
Superseder Nosy List
Related Issues
Status needs-screening Assigned To

Created on 2018-02-08.00:42:31 by bf, last changed 2018-02-10.19:03:16 by gh.

File name Status Uploaded Type Edit Remove
use-crypto_hash_sha256_hashlazy-in-darcs_util_hash.dpatch bf, 2018-02-08.00:42:31 application/x-darcs-patch
use-crypto_hash_sha256_hashlazy-in-darcs_util_hash.dpatch gh, 2018-02-09.20:09:33 application/octet-stream
See mailing list archives for discussion on individual patches.
msg19858 (view) Author: gh Date: 2018-02-08.18:57:38
Do we know why we have at the same time Darcs.Util.Hash and
Darcs.Util.Crypt.SHA256 ?
msg19865 (view) Author: gh Date: 2018-02-09.20:09:33
Answer: Darcs.Util.Hash is from the hashed-storage code which was merged
into Darcs in 2011, while  Darcs.Util.Crypt.{SHA1|SHA256} are Darcs's
earlier modules.

I'm attaching the following two cleanup patches, work in progress:

patch f7553052a1f0b396c38db7f6459ea815897de5c0
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Fri Feb  9 16:44:29 -03 2018
  * move sha256sum code to Darcs.Util.Hash

patch 6547d0ca5491adc0c7e42b37b1887d528612a919
Author: Guillaume Hoffmann <guillaumh@gmail.com>
Date:   Fri Feb  9 17:02:31 -03 2018
  * move Darcs.Util.Crypt.SHA1 to Darcs.Util.SHA1

The next step would be to switch to cryptonite and remove the
Darcs.Util.SHA1 module altogether.
msg19867 (view) Author: gh Date: 2018-02-10.00:22:01
Careful that I have experienced hash failures with the whole set of
patches (yours and mine)...
msg19869 (view) Author: bf Date: 2018-02-10.15:39:09
Your last remark is a bit cryptic (pun unintentional). Could you elaborate?
msg19874 (view) Author: gh Date: 2018-02-10.19:03:16
Yes, sorry.

With a locally compiled Darcs with these 3 patches, it seemed that it
recorded a patch with an incorrect hash. After recording a patch I could
not even run "darcs log" or "darcs amend" because said patch could not
be found. The message in question was "hash failure". I had to manually
edit _darcs/hashed_inventory  and run "darcs repair" t ohavea useable

But I do not know which of the patches created the issue!
Date User Action Args
2018-02-08 00:42:31bfcreate
2018-02-08 18:57:38ghsetmessages: + msg19858
2018-02-09 20:09:33ghsetfiles: + use-crypto_hash_sha256_hashlazy-in-darcs_util_hash.dpatch
messages: + msg19865
2018-02-10 00:22:02ghsetmessages: + msg19867
2018-02-10 15:39:09bfsetmessages: + msg19869
2018-02-10 19:03:16ghsetmessages: + msg19874