Skip to content

test: improve TimingResistantEqual test coverage#271

Open
mangoostaa wants to merge 1 commit intobitcoin-core:masterfrom
mangoostaa:test/improve-timingresistantequal
Open

test: improve TimingResistantEqual test coverage#271
mangoostaa wants to merge 1 commit intobitcoin-core:masterfrom
mangoostaa:test/improve-timingresistantequal

Conversation

@mangoostaa
Copy link
Copy Markdown
Contributor

This improves the test for TimingResistantEqual by adding more relevant edge cases, including:

  • Empty string vs non-empty string
  • Differences at the beginning of the string
  • Additional prefix/suffix length mismatch tests

These cases help ensure the function properly resists timing attacks when comparing secrets of different lengths

@DrahtBot
Copy link
Copy Markdown

DrahtBot commented Apr 13, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@ViniciusCestarii
Copy link
Copy Markdown
Contributor

Is there a planned call site for TimingResistantEqual? Is there any place libmultiprocess would need a constant-time comparison?

@mangoostaa
Copy link
Copy Markdown
Contributor Author

Is there a planned call site for TimingResistantEqual? Is there any place libmultiprocess would need a constant-time comparison?

You're right, currently there is no clear call site in libmultiprocess that requires constant-time comparison.
This test only improves coverage for the existing function, but I agree that without a concrete use case it might not be justified here.

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.

3 participants