Skip to content

Commit

Permalink
fix: analyzer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
murali-shris committed Dec 19, 2024
1 parent 632985c commit 8ac9637
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/at_chops/lib/src/algorithm/padding/pkcs7padding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ class PKCS7Padding implements PaddingAlgorithm {
PKCS7Padding(this._paddingParams);
@override
List<int> addPadding(List<int> data) {
if (_paddingParams.blockSize == null ||
_paddingParams.blockSize! <= 0 ||
_paddingParams.blockSize! > 255) {
if (_paddingParams.blockSize <= 0 || _paddingParams.blockSize > 255) {
throw AtEncryptionException('Block size must be between 1 and 255.');
}

// Calculate the number of padding bytes needed
int padding =
_paddingParams.blockSize! - (data.length % _paddingParams.blockSize!);
_paddingParams.blockSize - (data.length % _paddingParams.blockSize);

// Add padding bytes to the data
List<int> paddedData = List.from(data);
Expand Down

0 comments on commit 8ac9637

Please sign in to comment.