Skip to content

Conversation

patrick-ogrady
Copy link
Contributor

@patrick-ogrady patrick-ogrady commented Jul 22, 2025

Resolves: #1304

Results

lthash::add/bytes=32    time:   [2.6530 µs 2.6585 µs 2.6651 µs]
lthash::add/bytes=256   time:   [2.8802 µs 2.9137 µs 2.9496 µs]
lthash::add/bytes=1024  time:   [3.4665 µs 3.4728 µs 3.4800 µs]
lthash::add/bytes=4096  time:   [4.5353 µs 4.5444 µs 4.5541 µs]
lthash::subtract/bytes=32
                        time:   [2.6556 µs 2.6718 µs 2.6900 µs]
lthash::subtract/bytes=256
                        time:   [2.8127 µs 2.8217 µs 2.8330 µs]
lthash::subtract/bytes=1024
                        time:   [3.5216 µs 3.5366 µs 3.5533 µs]
lthash::combine         time:   [146.43 ns 149.76 ns 153.44 ns]
lthash::checksum        time:   [8.0669 µs 8.0919 µs 8.1181 µs]
lthash::update/incremental
                        time:   [11.406 µs 11.652 µs 11.927 µs]
lthash::update/full
                        time:   [26.726 ms 27.201 ms 27.877 ms]

@patrick-ogrady patrick-ogrady requested a review from Copilot July 22, 2025 21:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces an LtHash implementation, which is an additive homomorphic hash function built on top of Blake3. The implementation allows for efficient incremental updates to hash sets by supporting addition, subtraction, and combination operations while maintaining commutativity and associativity properties.

  • Implements a new LtHash struct with homomorphic hash capabilities
  • Provides comprehensive benchmarking suite for performance analysis
  • Includes extensive test coverage for all mathematical properties

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

File Description
cryptography/src/lthash/mod.rs Core implementation of the LtHash homomorphic hash function with full API
cryptography/src/lib.rs Adds lthash module to the public API
cryptography/Cargo.toml Adds benchmark configuration for lthash
cryptography/src/lthash/benches/*.rs Complete benchmarking suite testing various operations
Comments suppressed due to low confidence (2)

cryptography/src/lthash/mod.rs:52

  • The method finalize() is called in the example but the actual method is named checksum(). This will cause the example to fail compilation.
//! assert_eq!(lthash.finalize(), lthash2.finalize());

cryptography/src/lthash/mod.rs:59

  • The method finalize() is called in the example but the actual method is named checksum(). This will cause the example to fail compilation.
//! assert_eq!(lthash2.finalize(), lthash3.finalize());

@patrick-ogrady patrick-ogrady marked this pull request as ready for review July 22, 2025 21:55
@patrick-ogrady patrick-ogrady merged commit 7091610 into main Jul 22, 2025
33 checks passed
@patrick-ogrady patrick-ogrady deleted the lthash branch July 22, 2025 22:26
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

Attention: Patch coverage is 98.12500% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.23%. Comparing base (b5034a4) to head (72de2f5).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
cryptography/src/lthash/mod.rs 98.12% 3 Missing ⚠️
@@            Coverage Diff             @@
##             main    #1307      +/-   ##
==========================================
+ Coverage   91.20%   91.23%   +0.02%     
==========================================
  Files         247      248       +1     
  Lines       61686    61930     +244     
==========================================
+ Hits        56258    56499     +241     
- Misses       5428     5431       +3     
Files with missing lines Coverage Δ
cryptography/src/lib.rs 100.00% <ø> (ø)
cryptography/src/lthash/mod.rs 98.12% <98.12%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b5034a4...72de2f5. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[cryptography] Implement LtHash

1 participant