Skip to content

Update safe_bcmp.c #18739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update safe_bcmp.c #18739

wants to merge 1 commit into from

Conversation

itashia
Copy link

@itashia itashia commented Jun 2, 2025

Refactor: Improve readability, documentation, and timing-attack resistance

  • Added detailed comments explaining function behavior and security considerations
  • Ensured timing-attack resistance by maintaining full loop execution
  • Used local variables to store string lengths for better readability
  • Replaced while loop with for for improved clarity
  • Removed unnecessary pre-declared variable i
  • Preserved use of volatile to prevent unwanted compiler optimizations
  • Renamed variables for clearer meaning
  • Cleaned up code structure for better maintainability
  • Preserved original algorithm and performance characteristics

Refactor: Improve readability, documentation, and timing-attack resistance

- Added detailed comments explaining function behavior and security considerations
- Ensured timing-attack resistance by maintaining full loop execution
- Used local variables to store string lengths for better readability
- Replaced `while` loop with `for` for improved clarity
- Removed unnecessary pre-declared variable `i`
- Preserved use of `volatile` to prevent unwanted compiler optimizations
- Renamed variables for clearer meaning
- Cleaned up code structure for better maintainability
- Preserved original algorithm and performance characteristics
@itashia itashia requested a review from bukka as a code owner June 2, 2025 11:36
@TimWolla
Copy link
Member

TimWolla commented Jun 2, 2025

see #18740 (comment)

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.

2 participants