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

Commit

Permalink
Merge pull request #19 from ipfs/add-poseidon
Browse files Browse the repository at this point in the history
Make poseidon hashes good hashes
  • Loading branch information
hsanjuan authored Feb 22, 2023
2 parents c45e93b + 4c96c93 commit 062f619
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,23 @@ 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.SHA2_256_TRUNC254_PADDED: true,
mh.X11: true,

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

0 comments on commit 062f619

Please sign in to comment.