Skip to content

bug fixes and cmake version improvements#6

Merged
avinal merged 2 commits into
mainfrom
avinal/improve
Dec 6, 2025
Merged

bug fixes and cmake version improvements#6
avinal merged 2 commits into
mainfrom
avinal/improve

Conversation

@avinal

@avinal avinal commented Dec 4, 2025

Copy link
Copy Markdown
Owner
  • Fix Blowfish and Blowfish2 correctness issues and improve initialization safety
  • Improve GitHub Actions flow and increase CMake version
  • Fixes cmake minimum required version #5

…ion safety

In Blowfish
- Fix incorrect F-function byte extraction (critical bug).
- Correct key-schedule handling by using `uint8_t` key bytes.
- Initialize local variables in `initialize()` to prevent UB.
- Improve decrypt loop and XOR usage for clarity and correctness.

In Blowfish2
- Zero-initialize P-array and S-boxes to guarantee deterministic state.
- Fix incorrect key size comment (448 bits, not 4224 bits).
- Improve F-function byte extraction clarity.
- Normalize round loop logic and use XOR-assignment.

Others
- Replace macro `N` with `constexpr N`.
- Add `noexcept` to internal operations.
- Add `initialize(const uint8_t*, size_t)` overload for binary keys.
- Clean up readability and internal consistency across both ciphers.

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
- Increased CMake minimum version to 3.30
- added test run in github workflow

Signed-off-by: Avinal Kumar <avinal.xlvii@gmail.com>
@avinal avinal merged commit 9d303b7 into main Dec 6, 2025
10 checks passed
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.

cmake minimum required version

1 participant