fix: allow AES128 override via compile flag (#244) - #245
Open
AquaticAzelf wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #244 (
aes.h).Problem
aes.h:27hard-coded#define AES128 1with//#define AES192/256commented out, sogcc -DAES256=1orgcc -DAES192=1still leavesAES128defined. The#ifchain ataes.h:33-41picksAES256first, but the unconditionalAES128is confusing and forces editing the file to disable 128 when building 192/256.Solution
aes.h:27-33— makeAES128default only when neitherAES192norAES256is defined, matching the existing#ifndef CBC/ECB/CTRpattern (aes.h:14-24):Now:
-D):AES128=1(unchanged)gcc -DAES192=1: onlyAES192(AES128 not defined)gcc -DAES256=1: onlyAES256gcc -DAES128=0: respects explicit disableNo other files changed (single header, 6 insertions, 2 deletions). Follows same guard style as
CBC/ECB/CTRat top of file.Verification (folder-local)
C:\Users\Azelf\AppData\Local\Temp\opencode\tiny-AES-c-fix, editedaes.h,git diff --stat=1 file changed, 6 insertions(+), 2 deletions(-)pip install -g, nonpm install -g— only local edit.gccnot available on this Windows host, so compile check noted asTODO: gcc -c aes.c,gcc -DAES256=1 -c aes.c,gcc -DAES192=1 -c aes.cshould all succeed with correctAES_keyExpSize(176/208/240). Syntax follows existing#ifndefguards, so low risk.Stars: 5000★ (not zero), 33 open issues, updated 2026.
Closes #244