Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Make poseidon hashes good hashes
Browse files Browse the repository at this point in the history
This hash function is heavily used by Filecoin, making Kubo unable to operate
with Filecoin data.
  • Loading branch information
hsanjuan committed Feb 22, 2023
1 parent c45e93b commit d55ee9d
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@ const minimumHashLength = 20
const maximumHashLength = 128

var goodset = map[uint64]bool{
mh.SHA2_256: true,
mh.SHA2_512: true,
mh.SHA3_224: true,
mh.SHA3_256: true,
mh.SHA3_384: true,
mh.SHA3_512: true,
mh.SHAKE_256: true,
mh.DBL_SHA2_256: true,
mh.KECCAK_224: true,
mh.KECCAK_256: true,
mh.KECCAK_384: true,
mh.KECCAK_512: true,
mh.BLAKE3: true,
mh.IDENTITY: true,
mh.SHA2_256: true,
mh.SHA2_512: true,
mh.SHA3_224: true,
mh.SHA3_256: true,
mh.SHA3_384: true,
mh.SHA3_512: true,
mh.SHAKE_256: true,
mh.DBL_SHA2_256: true,
mh.KECCAK_224: true,
mh.KECCAK_256: true,
mh.KECCAK_384: true,
mh.KECCAK_512: true,
mh.BLAKE3: true,
mh.IDENTITY: true,
mh.POSEIDON_BLS12_381_A1_FC1: true,

mh.SHA1: true, // not really secure but still useful
}
Expand Down

0 comments on commit d55ee9d

Please sign in to comment.