Skip to content

Commit

Permalink
Bug 1626636 - Vendor rust-cascade v0.6.0 r=keeler
Browse files Browse the repository at this point in the history
Add salts, file format v2, SHA256 hash support, and logic inversion

Differential Revision: https://phabricator.services.mozilla.com/D69435

--HG--
rename : third_party/rust/rust_cascade/test_data/test_mlbf => third_party/rust/rust_cascade/test_data/test_v1_murmur_mlbf
rename : third_party/rust/rust_cascade/test_data/test_short_mlbf => third_party/rust/rust_cascade/test_data/test_v1_murmur_short_mlbf
extra : moz-landing-system : lando
  • Loading branch information
jcjones committed Apr 2, 2020
1 parent 2994551 commit 6ac6057
Show file tree
Hide file tree
Showing 16 changed files with 335 additions and 62 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion security/manager/ssl/cert_storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nserror = { path = "../../../../xpcom/rust/nserror" }
nsstring = { path = "../../../../xpcom/rust/nsstring" }
rental = "0.5.5"
rkv = { git = "https://github.com/mozilla/rkv", rev="e3c3388e6632cf55e08d773b32e58b1cab9b2731", default-features = false }
rust_cascade = "0.5.0"
rust_cascade = "0.6.0"
sha2 = "^0.8"
storage_variant = { path = "../../../../storage/variant" }
tempfile = "3"
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust/rust_cascade/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.toml":"5db04b6275c4130c2f7336e5481be3d43c1427c0a88399f7b9c355b71eca025c","README.md":"684439af17ec43b5a186e1c23c625681e06877a325e2ad13540bca47951de936","license.txt":"c76f740d1521b9bed9ca7a04ad526c310493c62621b1341d623b431736533b30","src/lib.rs":"c7ad9830c5aeb894897b045139f0d50265b1913d78bc4f19abc67c300083615e","test_data/test_mlbf":"243df0b7f2f55bfe3cefbba2d4be5eb7957c0a063559c9f284ca4c1ee4211eb5","test_data/test_short_mlbf":"3d4f03dc0a65cf5800efed6ac0b3c73e5b61e5d62bc82ac42744abc67f4c30fa"},"package":"6ea6999b1c6f2bd14e0208f7f3ffbd2774a9a98078148afc7251e789da930595"}
{"files":{"Cargo.toml":"411cb740d6be8346206164df646ac9df304e9a84bb9f10eb4b07d2ef2f6566ec","README.md":"a4396d1adf63a77ae9aa0d1d850d02d09eec4a92810a52d675163688f312b3e8","license.txt":"1f256ecad192880510e84ad60474eab7589218784b9a50bc7ceee34c2b91f1d5","src/lib.rs":"2c6d1e01ae3a39baad99cd4567b0164dec4dcf77688bc2c3b43798215c857943","test_data/make-sample-data.py":"68bcb106c3ac1929da52e1abb71cd2a6d59eb79549f6e40042368161baa920e0","test_data/requirements.txt":"cb9372b33ed2774e0d5040459fd63a2f9abae2be599869be43a2a077b2c08aa3","test_data/test_v1_murmur_mlbf":"243df0b7f2f55bfe3cefbba2d4be5eb7957c0a063559c9f284ca4c1ee4211eb5","test_data/test_v1_murmur_short_mlbf":"3d4f03dc0a65cf5800efed6ac0b3c73e5b61e5d62bc82ac42744abc67f4c30fa","test_data/test_v2_murmur_inverted_mlbf":"efdd0ab309883f6a3148ec2ddaf0dcb768790e6f130e4e0556994202b1fd7cc4","test_data/test_v2_murmur_mlbf":"80e8e148fbf95aed39783f1fcc2d4576074f8c487656ca2d53571da4b17e20a9","test_data/test_v2_sha256_inverted_mlbf":"e5148cabb45c4899f8220ca51f96a6c76c688e39dfd340ae56bf9dc5226eada2","test_data/test_v2_sha256_mlbf":"08986847b8b2f3bdf4d2df51e465938f88f7a7c401b1740094fc40b033e80b51","test_data/test_v2_sha256_salt_mlbf":"d7b9bf88872162a1917eb14d0340a88b61b574fb1a7120fa54d061e43a9f5460"},"package":"9a5b9bba8f5b985e4923dadd273a987f83669083f3355d65c699e02b9d3d854d"}
10 changes: 8 additions & 2 deletions third_party/rust/rust_cascade/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,13 @@

[package]
name = "rust_cascade"
version = "0.5.0"
authors = ["Mark Goodwin <[email protected]>", "Dana Keeler <[email protected]>"]
version = "0.6.0"
authors = ["Mark Goodwin <[email protected]>", "Dana Keeler <[email protected]>", "J.C. Jones <[email protected]>"]
description = "A simple mmh3 based bloom filter cascade implementation in Rust."
homepage = "https://github.com/mozilla/rust-cascade"
documentation = "https://docs.rs/rust_cascade/"
license = "MPL-2.0"
repository = "https://github.com/mozilla/rust-cascade"
[dependencies.byteorder]
version = "1.3.1"

Expand All @@ -24,3 +27,6 @@ version = "0.8.0"

[dependencies.murmurhash3]
version = "0.0.5"

[dependencies.sha2]
version = "^0.8"
13 changes: 10 additions & 3 deletions third_party/rust/rust_cascade/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# rust-cascade
A filter cascade implementation in rust. This uses the 32 bit version of the MurmurHash3 algorithm and is specifically implemented for compatibility with a specific
python filter cascade implementation (https://github.com/mozilla/crlite/blob/master/create_filter_cascade/FilterCascade.py).
A Bloom filter cascade implementation in rust. This can utilize one of two hash
functions:

See tests in src/lib.rs to get an idea of usage.
* MurmurHash32, or
* SHA256, with an optional salt

This implementation is designed to match up with the Python [filter-cascade
project](https://pypi.org/project/filtercascade/)
[[github](https://github.com/mozilla/filter-cascade)]

See tests in src/lib.rs to get an idea of usage.
4 changes: 2 additions & 2 deletions third_party/rust/rust_cascade/license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Mozilla Public License Version 2.0
means any form of the work other than Source Code Form.

1.7. "Larger Work"
means a work that combines Covered Software with other material, in
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.

1.8. "License"
Expand Down Expand Up @@ -370,4 +370,4 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------

This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.
defined by the Mozilla Public License, v. 2.0.
Loading

0 comments on commit 6ac6057

Please sign in to comment.