Skip to content

Feature/Add common interface for padding #420

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

Merged
merged 12 commits into from
Oct 17, 2023

Conversation

Kalkwst
Copy link
Contributor

@Kalkwst Kalkwst commented Oct 13, 2023

I have added a new interface IBlockCipherPadding that defines the methods that an algorithm that implements block cipher padding must follow. This will allow to have a more organized and structured codebase regarding padding algorithms that can be used in block ciphers.

I have also added a new InvalidPaddingException to better convey issues within the padding algorithms, such as invalid padding length or format.

This PR is related to issue #410

  • I have performed a self-review of my code
  • My code follows the style guidelines of this project
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Comments in areas I changed are up to date
  • I have added comments to hard-to-understand areas of my code
  • I have made corresponding changes to the README.md

@Kalkwst Kalkwst requested a review from siriak as a code owner October 13, 2023 19:28
@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (60d4de0) 96.10% compared to head (da3d488) 96.12%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
+ Coverage   96.10%   96.12%   +0.02%     
==========================================
  Files         234      234              
  Lines        9843     9843              
==========================================
+ Hits         9460     9462       +2     
+ Misses        383      381       -2     
Files Coverage Δ
Algorithms/Crypto/Paddings/Iso10126D2Padding.cs 100.00% <ø> (ø)
Algorithms/Crypto/Paddings/Iso7816D4Padding.cs 100.00% <ø> (ø)
Algorithms/Crypto/Paddings/Pkcs7Padding.cs 100.00% <ø> (+3.44%) ⬆️
Algorithms/Crypto/Paddings/TbcPadding.cs 100.00% <ø> (ø)
Algorithms/Crypto/Paddings/X932Padding.cs 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@siriak siriak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@siriak siriak merged commit 7de8efb into TheAlgorithms:master Oct 17, 2023
@Kalkwst Kalkwst deleted the feature/Issue410 branch October 17, 2023 13:07
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.

2 participants