publet-algorithms 0.2.1

Generic algorithms publet is built on: an RFC 6962 Merkle log, sorted-set membership with absence proofs, recursive content trees, exact fixed-point arithmetic, and deterministic trust propagation. Depends on nothing publet-specific.
Documentation
# Testing: publet-algorithms

Generated by `tools/doc-coverage.py`; do not edit.

55 public items; 45 of 45 functions have examples, and 37 items name the tests that cover them.

Every example in the documentation runs as a test (`cargo test --doc`). A
test is listed against an item when its `// covers:` comment says it exercises
that item: as the subject of the test, or within the same module to set it up.
A test claims only items of the module it tests. The files are linked below.

| Item | Examples | Tests |
|---|---|---|
| `CycleThroughStart` | - | - |
| `Fixed6` | - | - |
| `Fixed6::from_integer` | 1 | `mul_div_keeps_the_scale`, `truncates_toward_zero_rather_than_rounding` |
| `Fixed6::from_scaled` | 1 | `addition_saturates_rather_than_wrapping`, `display_is_stable_to_six_places`, `fixed_point_results_match_integer_arithmetic`, `mul_div_keeps_the_scale` |
| `Fixed6::halve_fractional` | 1 | `fixed_point_results_match_integer_arithmetic`, `halving_is_exact_on_whole_periods` |
| `Fixed6::is_zero` | 1 | - |
| `Fixed6::min` | 1 | - |
| `Fixed6::mul_div` | 1 | `division_by_zero_yields_zero`, `fixed_point_results_match_integer_arithmetic`, `mul_div_keeps_the_scale` |
| `Fixed6::ratio` | 1 | `division_by_zero_yields_zero`, `fixed_point_results_match_integer_arithmetic`, `truncates_toward_zero_rather_than_rounding` |
| `Fixed6::times` | 1 | `fixed_point_results_match_integer_arithmetic` |
| `Fixed6::to_scaled` | 1 | `fixed_point_results_match_integer_arithmetic` |
| `graph::closure` | 1 | `closure_excludes_the_start_and_refuses_a_cycle_through_it`, `the_closure_is_what_the_start_reaches_by_at_least_one_edge` |
| `graph::reachable` | 1 | `reachable_is_breadth_first_from_the_start`, `the_closure_is_what_the_start_reaches_by_at_least_one_edge` |
| `graph::reaches` | 1 | `reaches_finds_paths_and_a_node_reaches_itself`, `the_closure_is_what_the_start_reaches_by_at_least_one_edge` |
| `graph::root` | 1 | `root_follows_parents_and_stops_on_a_cycle` |
| `graph::topological_order` | 1 | `a_topological_order_puts_every_dependency_first`, `topological_order_names_the_cycle`, `topological_order_puts_dependencies_first` |
| `Hash` | - | - |
| `log::checkpoints` | 1 | - |
| `log::consistency_proof` | 1 | `a_rewritten_history_fails_consistency`, `a_tampered_consistency_proof_is_rejected`, `a_truncated_history_fails_consistency`, `consistency_proofs_agree`, `consistency_proofs_match_rfc_6962`, `consistency_proofs_round_trip_for_every_pair` |
| `log::empty_root` | 1 | `matches_rfc6962_constants`, `roots_match_the_certificate_transparency_test_vectors` |
| `log::fetches_required` | 1 | - |
| `log::inclusion_proof` | 1 | `a_tampered_inclusion_path_is_rejected`, `an_inclusion_proof_does_not_verify_a_different_leaf`, `audit_paths_agree`, `audit_paths_match_rfc_6962`, `inclusion_proofs_round_trip_for_every_index_and_size` |
| `log::leaf_hash` | 1 | `a_rewritten_history_fails_consistency`, `a_tampered_consistency_proof_is_rejected`, `a_tampered_inclusion_path_is_rejected`, `a_truncated_history_fails_consistency`, `an_inclusion_proof_does_not_verify_a_different_leaf`, `consistency_proofs_round_trip_for_every_pair`, `identical_sizes_require_an_empty_proof_and_equal_roots`, `inclusion_proofs_round_trip_for_every_index_and_size`, `leaf_and_interior_hashes_are_domain_separated`, `matches_rfc6962_constants`, `roots_agree`, `roots_match_the_certificate_transparency_test_vectors` |
| `log::node_hash` | 1 | `leaf_and_interior_hashes_are_domain_separated` |
| `log::root` | 1 | `a_rewritten_history_fails_consistency`, `a_tampered_consistency_proof_is_rejected`, `a_tampered_inclusion_path_is_rejected`, `a_truncated_history_fails_consistency`, `an_inclusion_proof_does_not_verify_a_different_leaf`, `consistency_proofs_round_trip_for_every_pair`, `identical_sizes_require_an_empty_proof_and_equal_roots`, `inclusion_proofs_round_trip_for_every_index_and_size`, `roots_agree`, `roots_match_the_certificate_transparency_test_vectors` |
| `log::to_hex` | 1 | `matches_rfc6962_constants`, `roots_match_the_certificate_transparency_test_vectors` |
| `log::verify_consistency` | 1 | `a_rewritten_history_fails_consistency`, `a_tampered_consistency_proof_is_rejected`, `a_truncated_history_fails_consistency`, `absurd_sizes_are_refused_without_hanging`, `consistency_proofs_match_rfc_6962`, `consistency_proofs_round_trip_for_every_pair`, `identical_sizes_require_an_empty_proof_and_equal_roots`, `sizes_beyond_a_32_bit_usize_are_checked_like_any_other` |
| `log::verify_inclusion` | 1 | `a_tampered_inclusion_path_is_rejected`, `absurd_sizes_are_refused_without_hanging`, `an_inclusion_proof_does_not_verify_a_different_leaf`, `audit_paths_match_rfc_6962`, `inclusion_proofs_round_trip_for_every_index_and_size`, `sizes_beyond_a_32_bit_usize_are_checked_like_any_other` |
| `Membership` | - | - |
| `membership::diff` | 1 | `diff_reports_additions_and_removals_in_sorted_order` |
| `Membership::is_empty` | 1 | - |
| `Membership::len` | 1 | `duplicates_do_not_change_the_root` |
| `Membership::members` | 1 | - |
| `Membership::new` | 1 | `a_changed_membership_changes_the_root`, `a_tampered_bracket_is_rejected`, `absent_members_prove_absence`, `an_absence_proof_does_not_verify_a_present_member`, `diff_reports_additions_and_removals_in_sorted_order`, `duplicates_do_not_change_the_root`, `non_adjacent_brackets_are_rejected`, `present_members_prove_inclusion`, `the_root_is_independent_of_insertion_order` |
| `Membership::prove` | 1 | `a_tampered_bracket_is_rejected`, `absent_members_prove_absence`, `an_absence_proof_does_not_verify_a_present_member`, `an_empty_membership_proves_absence_of_everything`, `non_adjacent_brackets_are_rejected`, `present_members_prove_inclusion` |
| `Membership::root` | 1 | `a_changed_membership_changes_the_root`, `a_tampered_bracket_is_rejected`, `absent_members_prove_absence`, `an_absence_proof_does_not_verify_a_present_member`, `an_empty_membership_proves_absence_of_everything`, `duplicates_do_not_change_the_root`, `non_adjacent_brackets_are_rejected`, `present_members_prove_inclusion`, `the_root_is_independent_of_insertion_order` |
| `membership::verify` | 1 | `a_tampered_bracket_is_rejected`, `absent_members_prove_absence`, `an_absence_proof_does_not_verify_a_present_member`, `an_empty_membership_proves_absence_of_everything`, `non_adjacent_brackets_are_rejected`, `present_members_prove_inclusion` |
| `Node` | - | - |
| `Node::branch` | 1 | `a_branch_commits_to_its_children`, `a_leaf_and_a_branch_never_collide_even_with_matching_bytes`, `child_insertion_order_does_not_affect_the_hash`, `find_resolves_a_slash_joined_path`, `leaves_lists_every_leaf_with_its_full_path_in_sorted_order`, `nesting_propagates_a_leaf_change_to_every_ancestor`, `renaming_a_child_changes_the_branch_hash_even_if_content_is_identical` |
| `Node::children` | 1 | - |
| `Node::find` | 1 | `find_resolves_a_slash_joined_path`, `nesting_propagates_a_leaf_change_to_every_ancestor` |
| `Node::hash` | 1 | `a_branch_commits_to_its_children`, `a_leaf_and_a_branch_never_collide_even_with_matching_bytes`, `child_insertion_order_does_not_affect_the_hash`, `find_resolves_a_slash_joined_path`, `nesting_propagates_a_leaf_change_to_every_ancestor`, `renaming_a_child_changes_the_branch_hash_even_if_content_is_identical`, `two_leaves_with_different_content_hash_differently`, `two_leaves_with_the_same_content_hash_the_same` |
| `Node::is_branch` | 1 | - |
| `Node::leaf` | 1 | `a_branch_commits_to_its_children`, `child_insertion_order_does_not_affect_the_hash`, `find_resolves_a_slash_joined_path`, `leaves_lists_every_leaf_with_its_full_path_in_sorted_order`, `nesting_propagates_a_leaf_change_to_every_ancestor`, `renaming_a_child_changes_the_branch_hash_even_if_content_is_identical`, `two_leaves_with_different_content_hash_differently`, `two_leaves_with_the_same_content_hash_the_same` |
| `Node::leaves` | 1 | `leaves_lists_every_leaf_with_its_full_path_in_sorted_order` |
| `Node::with_child` | 1 | `a_branch_commits_to_its_children`, `child_insertion_order_does_not_affect_the_hash`, `find_resolves_a_slash_joined_path`, `leaves_lists_every_leaf_with_its_full_path_in_sorted_order`, `nesting_propagates_a_leaf_change_to_every_ancestor`, `renaming_a_child_changes_the_branch_hash_even_if_content_is_identical` |
| `Params` | - | - |
| `Proof` | - | - |
| `propagate::propagate` | 1 | `a_subject_confined_edge_applies_only_within_that_subject`, `an_unvouched_subgraph_receives_no_weight_at_any_size`, `decay_reduces_an_older_edge`, `propagation_is_invariant_under_input_order`, `propagation_is_reproducible_across_runs`, `vouching_for_more_nodes_does_not_confer_more_weight` |
| `propagate::propagate_within` | 1 | `a_subject_confined_edge_applies_only_within_that_subject` |
| `propagate::reachable_within` | 1 | `reachability_is_undirected_and_bounded_by_distance` |
| `Seed` | - | - |
| `TrustEdge` | - | - |
| `version::satisfies` | 1 | `a_caret_is_compatible_as_cargo_reads_it`, `a_minimum_compares_part_by_part`, `a_requirement_is_a_version_prefix_at_a_dot_boundary`, `version_requirements_match_the_rules` |
| `Weights` | - | - |

Test files:

- [`crates/publet-algorithms/src/fixed.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/src/fixed.rs)
- [`crates/publet-algorithms/src/graph.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/src/graph.rs)
- [`crates/publet-algorithms/src/version.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/src/version.rs)
- [`crates/publet-algorithms/tests/graph.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/tests/graph.rs)
- [`crates/publet-algorithms/tests/log.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/tests/log.rs)
- [`crates/publet-algorithms/tests/membership.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/tests/membership.rs)
- [`crates/publet-algorithms/tests/oracles.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/tests/oracles.rs)
- [`crates/publet-algorithms/tests/propagate.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/tests/propagate.rs)
- [`crates/publet-algorithms/tests/tree.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/tests/tree.rs)
- [`crates/publet-algorithms/tests/vectors.rs`](https://github.com/schryer/publet/blob/main/crates/publet-algorithms/tests/vectors.rs)