Skip to content

fix: bind prepared cache to setup generators - #29

Draft
0xAndoroid wants to merge 1 commit into
mainfrom
fix/prepared-cache-identity
Draft

fix: bind prepared cache to setup generators#29
0xAndoroid wants to merge 1 commit into
mainfrom
fix/prepared-cache-identity

Conversation

@0xAndoroid

Copy link
Copy Markdown
Collaborator

Summary

  • bind prepared G1/G2 points to their source generator values, not only vector lengths
  • validate the cached prefix before every setup-specialized pairing; mismatches fall back to uncached preparation
  • reinitialize equal-length caches when generator values differ while retaining matching-prefix reuse
  • remove correctness dependence on cache invalidation during setup creation and persistence

Failure mode

init_cache previously treated any cached vectors of sufficient length as reusable. multi_pair_g1_setup and multi_pair_g2_setup then consumed those prepared points without checking the generator arguments. Two random setups of the same size therefore produced silently incorrect pairings.

Regression coverage

  • equal-length setup replacement
  • cached G1 and G2 pairing fallback for a different setup
  • matching-prefix cache reuse

Verification

  • cargo nextest run --all-features --cargo-quiet
  • cargo clippy --all-features -q --all-targets --message-format=short -- -D warnings
  • cargo doc --all-features -q --message-format=short --no-deps
  • cargo fmt -q --message-format=short

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.

1 participant