-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move CID-related constants to FVM-owned crates. (#1543)
- Loading branch information
Showing
5 changed files
with
14 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,6 @@ | ||
// Copyright 2019-2022 ChainSafe Systems | ||
// SPDX-License-Identifier: Apache-2.0, MIT | ||
|
||
use multihash::derive::Multihash; | ||
|
||
/// Multihash code for Poseidon BLS replica commitments. | ||
pub const POSEIDON_BLS12_381_A1_FC1: u64 = 0xb401; | ||
|
||
/// Multihash code for Sha2 256 trunc254 padded used in data commitments. | ||
pub const SHA2_256_TRUNC254_PADDED: u64 = 0x1012; | ||
|
||
/// Multihash generation codes for the Filecoin protocol. This is not an exhausting list of | ||
/// codes used, just the ones used to generate multihashes. | ||
#[derive(Clone, Copy, Debug, Eq, Multihash, PartialEq)] | ||
#[mh(alloc_size = 64)] | ||
pub enum Code { | ||
/// BLAKE2b-256 (32-byte hash size) | ||
#[mh(code = 0xb220, hasher = multihash::Blake2bHasher::<32>)] | ||
Blake2b256, | ||
|
||
/// Identity multihash (max 32 bytes) | ||
#[mh(code = 0x00, hasher = multihash::IdentityHasher::<32>)] | ||
Identity, | ||
} | ||
pub use cid::multihash::Code; | ||
pub use fvm_shared::commcid::POSEIDON_BLS12_381_A1_FC1; | ||
pub use fvm_shared::commcid::SHA2_256_TRUNC254_PADDED; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters