Skip to content

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.


This commit was moved from ipfs/go-verifcid@d55ee9d
  • Loading branch information
hsanjuan committed Feb 22, 2023
1 parent 790ce94 commit 61d62da
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions verifcid/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 61d62da

Please sign in to comment.