Skip to content

feat(utils): harden constant-time comparison - #25

Merged
LimiNode merged 1 commit into
mainfrom
codex/add-constant-time-string-comparison-helper
Sep 3, 2025
Merged

feat(utils): harden constant-time comparison#25
LimiNode merged 1 commit into
mainfrom
codex/add-constant-time-string-comparison-helper

Conversation

@LimiNode

@LimiNode LimiNode commented Sep 3, 2025

Copy link
Copy Markdown
Owner

Summary

  • ensure constant_time_equals walks full string length without early exit
  • test constant_time_equals for matching and mismatching inputs

Testing

  • g++ -std=c++17 test_all.cpp hmac_utils.cpp hmac.cpp sha1.cpp sha256.cpp sha512.cpp -lgtest -lgtest_main -pthread -o test_all
  • ./test_all
  • g++ -std=c++17 test_totp.cpp hmac_utils.cpp hmac.cpp sha1.cpp sha256.cpp sha512.cpp -pthread -o test_totp
  • ./test_totp

https://chatgpt.com/codex/tasks/task_e_68b8c17e76a0832c82b1b3b2613f001e

Ensure comparison covers full input length and add tests for matching and mismatching cases.
@LimiNode
LimiNode merged commit d416ceb into main Sep 3, 2025
4 checks passed
@LimiNode
LimiNode deleted the codex/add-constant-time-string-comparison-helper branch September 4, 2025 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant