Skip to content
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

[Bug]: HasPadding edge-case #188

Closed
ShortDevelopment opened this issue Jan 12, 2025 · 0 comments · Fixed by #190
Closed

[Bug]: HasPadding edge-case #188

ShortDevelopment opened this issue Jan 12, 2025 · 0 comments · Fixed by #190
Assignees
Labels
area::libCdp All things related to the custom implementation type::bug Something isn't working

Comments

@ShortDevelopment
Copy link
Member

ShortDevelopment commented Jan 12, 2025

HasPadding fails if last byte of plainText equals 1 or 0 but has no padding.

static bool HasPadding(ReadOnlySpan<byte> buffer, out byte paddingSize)
{
paddingSize = buffer[^1];
for (int i = buffer.Length - paddingSize; i < buffer.Length; i++)
{
if (paddingSize != buffer[i])
return false;
}
return true;
}

@ShortDevelopment ShortDevelopment added type::bug Something isn't working area::libCdp All things related to the custom implementation labels Jan 12, 2025
@ShortDevelopment ShortDevelopment self-assigned this Jan 12, 2025
@ShortDevelopment ShortDevelopment moved this to 🏗 In progress in libCdp Jan 26, 2025
@ShortDevelopment ShortDevelopment linked a pull request Jan 26, 2025 that will close this issue
@github-project-automation github-project-automation bot moved this from 🏗 In progress to 🧪 Testing in libCdp Jan 26, 2025
@ShortDevelopment ShortDevelopment marked this as a duplicate of #184 Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area::libCdp All things related to the custom implementation type::bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant