Skip to content

Throw error for unsupported HMAC hash types - #26

Merged
LimiNode merged 1 commit into
mainfrom
codex/throw-exception-for-unsupported-hmac-type
Sep 3, 2025
Merged

Throw error for unsupported HMAC hash types#26
LimiNode merged 1 commit into
mainfrom
codex/throw-exception-for-unsupported-hmac-type

Conversation

@LimiNode

@LimiNode LimiNode commented Sep 3, 2025

Copy link
Copy Markdown
Owner

Summary

  • Raise std::invalid_argument when get_hmac receives an unsupported TypeHash
  • Add unit test expecting an exception for invalid hash types

Testing

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

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

Raise std::invalid_argument when an unsupported hash type is requested and adjust tests to expect the exception.
@LimiNode
LimiNode merged commit d79561f into main Sep 3, 2025
4 checks passed
@LimiNode
LimiNode deleted the codex/throw-exception-for-unsupported-hmac-type 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