Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2c4f806
[storage] initial migration to crc32c
andresilva Jan 8, 2026
3df8f05
[runtime] import crc32 module from storage
andresilva Jan 8, 2026
b1f8365
[runtime/buffer] use crc32 module
andresilva Jan 8, 2026
0a4fc66
[workspace] remove crc32fast
andresilva Jan 8, 2026
3fa093f
[runtime/crc32] more tests
andresilva Jan 8, 2026
d973254
[runtime/crc32] verify against crc crate
andresilva Jan 8, 2026
8545410
[storage] stray comment
andresilva Jan 8, 2026
5c014b4
[storage] regenerate conformance
andresilva Jan 8, 2026
d49f551
[storage] fix reference to crc32::SIZE
andresilva Jan 8, 2026
e893bfe
[cryptography] import crc32 hasher
andresilva Jan 8, 2026
8473945
[runtime] cleanup checksum size
andresilva Jan 8, 2026
ffab542
[cryptography] conformance
andresilva Jan 8, 2026
43ba668
[runtime] fix unused warnings
andresilva Jan 8, 2026
a5e3d6a
[cryptography/crc32] docs
andresilva Jan 8, 2026
3be4969
[workspace] disable default features for crc-fast
andresilva Jan 8, 2026
5b7fd7e
[cryptography/crc32] don't expose SIZE const
andresilva Jan 8, 2026
73e7855
[cryptography] enable crc-fast panic-handler
andresilva Jan 8, 2026
b5619d2
[runtime] nit
andresilva Jan 8, 2026
20b7c41
[cryptography/crc32] remove useless fill
andresilva Jan 8, 2026
985168e
[cryptography] nits
andresilva Jan 8, 2026
7fc809e
[cryptography] better arbitrary for blake3, sha256 and crc32
andresilva Jan 8, 2026
b15afea
[cryptography] regenerate conformance
andresilva Jan 8, 2026
3762114
[cryptography] update conformance
andresilva Jan 8, 2026
4cbd258
Merge branch 'main' into andre/crc32c
andresilva Jan 8, 2026
9bfaf83
[workspace] regenerate conformance
andresilva Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ commonware-storage = { version = "0.0.64", path = "storage", default-features =
commonware-stream = { version = "0.0.64", path = "stream" }
commonware-utils = { version = "0.0.64", path = "utils", default-features = false }
console-subscriber = "0.5.0"
crc32fast = "1.5.0"
crc = "3.4.0"
crc-fast = { version = "1.10.0", default-features = false }
criterion = "0.7.0"
crossterm = "0.29.0"
ctutils = "0.3.1"
Expand Down
6 changes: 3 additions & 3 deletions coding/conformance.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ hash = "edc22446bb2952609d0c8daccf2d22f8ad2b71eedfcf45296c3f4db49d78404a"

["commonware_coding::reed_solomon::tests::conformance::CodecConformance<Chunk<Sha256>>"]
n_cases = 65536
hash = "7d6e1b7080b182d7b63a261faea8acd77c528c7b0ab99af750d9695457c0f2e3"
hash = "aa8512bb8e86e967833edd1a6cc806280d5e7334e9dc8428a098de9204db12d1"

["commonware_coding::test::conformance::CodecConformance<Config>"]
n_cases = 65536
hash = "1a412c5c279f981857081765537b85474184048d1b17053394f94fc42ac1dbf4"

["commonware_coding::zoda::tests::conformance::CodecConformance<ReShard<Sha256>>"]
n_cases = 65536
hash = "e71cd9c877d6e43195d41a00e840e67f134ce425f2c89a1c252fd0131a35cb75"
hash = "ebbbe08eb9beb1c5215a5d67ad9deddaef7c54920e53a751b56a8261e60e0e52"

["commonware_coding::zoda::tests::conformance::CodecConformance<Shard<Sha256>>"]
n_cases = 65536
hash = "0f69b872f96f5ee24a7f707dc496a7a4721d7f48dd17cb6792d514612ab1376f"
hash = "929ce4f95f9d5784f995c52b7e5cde8b62663ab068848925314dc9f80eb27d34"
54 changes: 27 additions & 27 deletions consensus/conformance.toml
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
["commonware_consensus::aggregation::types::tests::conformance::CodecConformance<Ack<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "650f939707e2af1e00091f813437689bebd63e401952cd34ae967511e8802366"
hash = "f53d34477165ef9764e4f2859e42c837f778c088a91ab69a6a7605ca56ff77c9"

["commonware_consensus::aggregation::types::tests::conformance::CodecConformance<Activity<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "6498f5323f4bef33ab441bb988081591ac315f55cd78f85bad9f0a7dcd03f579"
hash = "1f25d8ef3c67a8741ee8f566410e6bad03afa1aa3ce8b569ad33a904403dc0d5"

["commonware_consensus::aggregation::types::tests::conformance::CodecConformance<Certificate<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "6d62a98f635a930dcf01f2d5709f70190ef916cce774b7483eaf0092f0b5e1dc"
hash = "fde109e77996588a9cf8f9b723a9521d26148c0337b655f3c4cf0d92e9b12ff4"

["commonware_consensus::aggregation::types::tests::conformance::CodecConformance<Item<Sha256Digest>>"]
n_cases = 65536
hash = "69536ce6262449bc22fd256943545a3c9d8c5290b67a9a6e8396a5e5cf761961"
hash = "55b287b5530fc9ba77c45ec5030ada38f86b2ddf66a1595fde27d4699667b1a3"

["commonware_consensus::aggregation::types::tests::conformance::CodecConformance<TipAck<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "d22d425105d9dda042400a4040dfd06ddcc61957cffebad4b2d5c527979b07f3"
hash = "924a77caeabb871baa8ac0ccd93a2e53da86f124b0dd5b9b0a383273fab42b6c"

["commonware_consensus::marshal::ingress::handler::tests::conformance::CodecConformance<Request<B>>"]
n_cases = 65536
hash = "01475715f7713d6b0e856d97aa5789e6546178dacc8319de7ce17fe79a41d2d8"
hash = "481cd68f2e6452c0dda512c75d74ddd2e19ac6c9fb19c642c1a152a0d830c1b2"

["commonware_consensus::ordered_broadcast::types::tests::conformance::CodecConformance<Ack<PublicKey,Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "d77c48b9ee8b47ab689c67eff36add26f5cb503f615e971d0695cf8f99730e54"
hash = "6aa909d1f8ad45b30cce5169dd05bb743a3259a9d6612997879fb1057db01fa9"

["commonware_consensus::ordered_broadcast::types::tests::conformance::CodecConformance<Activity<PublicKey,Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "902584ad8634ae1eea9551343feddaf0c8b19cc1ca9bafa949c5fe07f61397ca"
hash = "030e7f6899fbbfd76a7757cfdaa57b400b4d0bc7662e883b304514e2a9bfb404"

["commonware_consensus::ordered_broadcast::types::tests::conformance::CodecConformance<Chunk<PublicKey,Sha256Digest>>"]
n_cases = 65536
hash = "b62ae4cd0dfe7ccd2193c2294be33784f37b1bdd9e4f8a6db640e745495f6e64"
hash = "43624c9e7ce355baebf32ab6e76db21cb5bf08005396ba43dae96b3a86f3a535"

["commonware_consensus::ordered_broadcast::types::tests::conformance::CodecConformance<Lock<PublicKey,Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "1ba3de6600c32bad42e2a70440a5fcb0ff4970866cd12fa955c1ccdec6ae0704"
hash = "32eac601e1ec919be9e8f502a47c8cd64e8feb61701689d2f9ff6f0a8ebafb03"

["commonware_consensus::ordered_broadcast::types::tests::conformance::CodecConformance<Node<PublicKey,Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "ce5158fafa28b1d9f033a19c5d33fa9d91f6a8940bbd5d42312d0e88804cdb0e"
hash = "b2dfff5e68de39db6881cfd7c5f95397f4330193b8eca5155a716266e53ea921"

["commonware_consensus::ordered_broadcast::types::tests::conformance::CodecConformance<Parent<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "f46dbf29df8571c17a69fbde128c4c62af0efdc3566b945f8add9938071c21db"
hash = "c830d0e3842c1f2ef26f08ee762995942bfbbc722ca9c5e8e6a87c3dbe05c70d"

["commonware_consensus::ordered_broadcast::types::tests::conformance::CodecConformance<Proposal<PublicKey,Sha256Digest>>"]
n_cases = 65536
hash = "9d2ee4f3c6bf86521c09f8858683de48d6310a987643ee379c143480fc7e9a34"
hash = "6fc6f17d8734a14fb841a8acc1a39cda7519bdd025700663e260d3b000c9c5c6"

["commonware_consensus::simplex::scheme::bls12381_threshold::tests::conformance::CodecConformance<Seed<MinSig>>"]
n_cases = 65536
Expand All @@ -60,43 +60,43 @@ hash = "030caacb9ab46d08601977418808dc5ff729bddb9f6bb2ea685920539b69ecfb"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Activity<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "f2da297d1d4f0a1bf238227a5cb3cad562a92ea00701960bfd3e5c3dae50d4bd"
hash = "15a849588cb0e5ea44d62c364c789aa564045c970b830b449b74a1f34720f799"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Artifact<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "36a54495de107b83b1e14ee8c0cf97199f175dad90d08ec272766bb0664296a0"
hash = "076241e74a3f2b0da47792d76277bd4f3b617ad429f298d887151d5dae2d42af"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Backfiller<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "080be68d5a9b2b564b6c1593c438884daaf2e077c6a04dd9f33feac422e4e36a"
hash = "c81cf2317351865d6a9786a60934995b2693cc759350a853bab7e277f758b5e6"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Certificate<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "a78db937a58c2ba47a07e614a1b1d38c71b8529a9fd55ae8672ae54142b7d49c"
hash = "1422a1e4db078efe00f3f8a5b391d315dc4661f29d24515144a74c65d84a320f"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<ConflictingFinalize<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "e309da1bb5891f59a73fb6e8b9982ef2d98bdd064bf8f6d9d72851e257674100"
hash = "ae3440a50566a8e2108c272e2934e2bd28a39715c2d6077ccda329d5d19c5357"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<ConflictingNotarize<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "e309da1bb5891f59a73fb6e8b9982ef2d98bdd064bf8f6d9d72851e257674100"
hash = "ae3440a50566a8e2108c272e2934e2bd28a39715c2d6077ccda329d5d19c5357"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Finalization<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "aab95f3f91f700f11302e98d1e13198d8f6ff2c5d852a27fbe659b4bb45c7e0e"
hash = "efbd478fdec6e832ffa445bf9cf0282b496bb0cbc45d6e0cf15281cd733b9978"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Finalize<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "b1be7e36c66125871070a7465dde3d4510ccb6f46bbcaef46c585611eb3c7bf4"
hash = "182a3d295140ffd4ea33fe5bbfd2b09156c76c4dcde06e71707ac3479345fa0c"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Notarization<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "aab95f3f91f700f11302e98d1e13198d8f6ff2c5d852a27fbe659b4bb45c7e0e"
hash = "efbd478fdec6e832ffa445bf9cf0282b496bb0cbc45d6e0cf15281cd733b9978"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Notarize<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "b1be7e36c66125871070a7465dde3d4510ccb6f46bbcaef46c585611eb3c7bf4"
hash = "182a3d295140ffd4ea33fe5bbfd2b09156c76c4dcde06e71707ac3479345fa0c"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Nullification<Scheme>>"]
n_cases = 65536
Expand All @@ -108,23 +108,23 @@ hash = "1430b3fac9de5758b9d00c8793d56fc57d1eddbf5ce2fd4f24d2229e4b15c226"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<NullifyFinalize<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "37fec8dca307c26dad1b6bb84960feb5239ccd739558db394a2a311176c1aab3"
hash = "8681786700e24b08366664c9c76a1a4b144ef7881b13c6468bb5ca78175baa09"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Proposal<Sha256Digest>>"]
n_cases = 65536
hash = "c5274c98a6c936c91f380261cff61c2dc9988e5f28700f0d9cb1b25346d1ffc3"
hash = "4ba1f5b5cbf271ae45313d8ac48b05c010166ca743334b9b8051a4a610c58fe7"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Request>"]
n_cases = 65536
hash = "6f852b6ad6e5dd77804d80781b03c808e186e7e7c5611752f124c625c5c3ee17"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Response<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "37c0c4f2dd328ed18a8f29fb73ca7c82c4008e49ea00243ffb3e024873a5b565"
hash = "6ad91c2b61600699c399c20abb6e9f948bf95ac413363c325226d327bbb37456"

["commonware_consensus::simplex::types::tests::conformance::CodecConformance<Vote<Scheme,Sha256Digest>>"]
n_cases = 65536
hash = "dec7851b91f56833b8f917c7e3ba16a28cd2683c68dda6c021c5d3c5c2400a37"
hash = "9eefedcb37bd0e098bcf47cf6135148900755f3eeca78f30b013433fe368678f"

["commonware_consensus::types::tests::conformance::CodecConformance<Epoch>"]
n_cases = 65536
Expand Down
3 changes: 3 additions & 0 deletions cryptography/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ commonware-codec.workspace = true
commonware-math.workspace = true
commonware-parallel.workspace = true
commonware-utils.workspace = true
crc-fast = { workspace = true, features = ["panic-handler"] }
ctutils.workspace = true
ecdsa.workspace = true
ed25519-consensus = { workspace = true, default-features = false }
Expand All @@ -50,6 +51,7 @@ features = ["js"]
anyhow.workspace = true
commonware-conformance.workspace = true
commonware-math = { workspace = true, features = ["test_strategies"] }
crc.workspace = true
criterion.workspace = true
proptest.workspace = true
rayon.workspace = true
Expand Down Expand Up @@ -81,6 +83,7 @@ std = [
"commonware-math/std",
"commonware-parallel/std",
"commonware-utils/std",
"crc-fast/std",
"ecdsa/std",
"ed25519-consensus/std",
"getrandom/std",
Expand Down
8 changes: 6 additions & 2 deletions cryptography/conformance.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
["commonware_cryptography::blake3::tests::conformance::CodecConformance<Digest>"]
n_cases = 65536
hash = "c0501d4a691d1fccec7c5906e8608228569d24164150edd215838593e3b77512"
hash = "d01e3ef0dd81919abd3f149649940ae2e8cff6dc4aa9f927d544aece387b12d1"

["commonware_cryptography::bloomfilter::tests::conformance::CodecConformance<BloomFilter>"]
n_cases = 65536
Expand Down Expand Up @@ -102,6 +102,10 @@ hash = "42867052b1619b912d08f0a6bf5f964f587897a0eed8612732fd27813f6c03bd"
n_cases = 65536
hash = "41ef7a306dd2032d7d1b73fe2799cff6f2e8fb1edcd02a0b9798f18f900a19fa"

["commonware_cryptography::crc32::tests::conformance::CodecConformance<Digest>"]
n_cases = 65536
hash = "d0101a0688d45c8f7428b3861ed6e7e77c2ed25033cb7d6b47b3fa58148a3f18"

["commonware_cryptography::ed25519::certificate::tests::conformance::CodecConformance<Certificate>"]
n_cases = 65536
hash = "eab4ff22bb7ed99fd73107c8b067e39bd25813b65614df95b4b5c46a312557ad"
Expand Down Expand Up @@ -164,7 +168,7 @@ hash = "05880099d66c9e04ab2d4bf5dfa3fecfc4fb114264ca3b4a0c3b4816332414b9"

["commonware_cryptography::sha256::tests::conformance::CodecConformance<Digest>"]
n_cases = 65536
hash = "c0501d4a691d1fccec7c5906e8608228569d24164150edd215838593e3b77512"
hash = "d65ced18cacd65769e8f9732131a06216e6600d5a115c4ed7483a8530813ddcd"

["commonware_cryptography::transcript::test::conformance::CodecConformance<Summary>"]
n_cases = 65536
Expand Down
11 changes: 10 additions & 1 deletion cryptography/src/blake3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,19 @@ impl Hasher for Blake3 {

/// Digest of a BLAKE3 hashing operation.
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[repr(transparent)]
pub struct Digest(pub [u8; DIGEST_LENGTH]);

#[cfg(feature = "arbitrary")]
impl<'a> arbitrary::Arbitrary<'a> for Digest {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
// Generate random bytes and compute their Blake3 hash
let len = u.int_in_range(0..=256)?;
let data = u.bytes(len)?;
Ok(Blake3::hash(data))
}
}

impl Write for Digest {
fn write(&self, buf: &mut impl BufMut) {
self.0.write(buf);
Expand Down
Loading
Loading