Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Skein hash to the mix #56

Merged
merged 1 commit into from
Oct 13, 2017
Merged

Conversation

DonaldTsang
Copy link
Contributor

@DonaldTsang DonaldTsang commented Jul 22, 2017

Skein is created by Bruce Schneier, one of the leader in cryptography.
It is as fast as BLAKE, faster than all other SHA3 finalists and SHA2.

Skein hashes can have arbitrary lengths up to 1024 bits.
A longer hash means files are less likely to have hash collisions.
They can also produce shorter hashes for higher speed.

Using b3xx code for 256-XXX, 512-XXX and 1024-XXX skein hashes would be good.
There are only 224 hashes in total (assuming we exclude hashes not multiple of 8).

References:
http://www.skein-hash.info/sites/default/files/skein1.3.pdf
www.skein-hash.info/sites/default/files/NIST_CD_102610.zip

Python implementation: https://pythonhosted.org/pyskein
Java, C and Go: https://github.com/wernerd/Skein3Fish

multiformats/multihash#83
multiformats/go-multihash#52
multiformats/js-multihash#34

@Kubuxu
Copy link
Member

Kubuxu commented Jul 30, 2017

@diasdavid LGTY, LGTM.

@DonaldTsang
Copy link
Contributor Author

@Kubuxu Thanks.

@Kubuxu Kubuxu requested review from daviddias, whyrusleeping and a user August 14, 2017 16:13
@Kubuxu
Copy link
Member

Kubuxu commented Aug 14, 2017

@whyrusleeping @lgierth can you tick off on that please?

Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM.

My sentiment is that we have to find a way to keep this table under control, it is getting massive fast

@daviddias daviddias merged commit 939adcc into multiformats:master Oct 13, 2017
@DonaldTsang
Copy link
Contributor Author

DonaldTsang commented Dec 4, 2018

@daviddias I did my own research into what Hashes are useful.
Out of all the hashes in SHA3 second and third round, only a few matters
(I am not saying that all of them belong in multi-codec but that they have interesting properties)

  • BLAKE and BLAKE2 (built to be faster than SHA512 and SHA256)
  • SHA3, SHAKE, KangarooTwelve and M14 (built to be faster than BLAKE2)
  • Skein (at least faster than SHA2, has 1024-bit options)
  • Blue Midnight Wish (round 2, near miss for finalist, faster than SHA1)
  • ECHO (round2, faster than SHA1, uses AES instructions for speedup)
  • SHAVite3 (round2, faster than SHA1, uses AES instructions for speedup)
  • SHABAL (round2, faster than SHA512 and SHA256, uses AES instructions for speedup)
  • Cubehash 8/32 (modified, faster than SHA1, slightly insecure, easy to write)

To add these in Go We have https://github.com/bitbandi/go-x11 or https://github.com/samli88/go-x11-hash
To add these in JS We have https://github.com/dashpay/x11-hash-js or https://github.com/AXErunners/x11-hash-js
(They only have the 512 bit version but 256 bit versions can be modified from that)

@DonaldTsang
Copy link
Contributor Author

quartile median quartile hash length type
2.20 2.21 2.23 k12 any Post-SHA3
2.54 2.55 2.57 md4 128 legacy
2.53 2.58 2.60 bmw512 512 <= This
2.71 2.72 2.75 echo256 256 <= This
2.91 2.92 2.93 blake2b 512 Post-SHA3
2.95 2.98 3.00 shavite3512 512 <= This
3.01 3.06 3.20 echosp256 256 <= This
3.04 3.06 3.09 sha1 160 legacy
3.34 3.35 3.37 shavite3256 256 <= This
3.52 3.54 3.55 cubehash832 512 <= This
3.98 4.02 4.05 keccakc256treed2 256 tree-SHA3
3.35 4.05 4.92 bmw256 256 <= This
4.04 4.26 4.70 blake2s 256 Post-SHA3
4.31 4.33 4.35 md5 128 legacy
4.39 4.45 4.49 sha384 384 legacy
4.43 4.47 4.51 shabal512 512 <= This
4.20 4.48 4.95 sha512 512 legacy
4.45 4.48 4.52 skein512512 512 Skein
4.41 4.48 4.63 blake512 512 BLAKE
4.47 4.51 4.54 skein512256 256 Skein
4.49 4.52 4.57 shake128 any SHA3+
4.49 4.57 4.70 echosp512 512 <= This
4.64 4.67 4.72 blake64 512 old-BLAKE
4.65 4.68 4.70 shabal256 256 <= This
4.89 4.93 4.98 keccakc512treed2 512 tree-SHA3
4.99 5.03 5.07 bblake256 256 TwinBLAKE
5.02 5.05 5.08 bash256 256 mystery
5.33 5.35 5.38 blake32 256 old-BLAKE
5.65 5.68 5.71 skein10241024 1024 Skein
5.55 5.78 6.53 sha3224 224 SHA3
5.63 5.95 6.57 blake256 256 BLAKE
5.91 6.06 6.12 shake256 any SHA3+
5.88 6.08 6.12 sha3256 256 SHA3
5.61 6.12 6.59 keccakc256 256 old-SHA3
6.20 6.53 7.09 bash384 384 mystery
6.61 6.65 6.69 sha256 256 legacy
6.64 6.67 6.72 sha224 224 legacy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants