Skip to content

Commit d4a89da

Browse files
NirmaNicholas Maccharoli
authored andcommitted
fix spacing after comma
1 parent 391cc31 commit d4a89da

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Sources/CryptoSwift/BlockMode/CCM.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class CCMModeWorker: StreamModeWorker, SeekableModeWorker, CounterModeWorker, Fi
102102
case invalidParameter
103103
}
104104

105-
init(blockSize: Int, nonce: ArraySlice<UInt8>, messageLength: Int, additionalAuthenticatedData: [UInt8]?, expectedTag: Array<UInt8>? = nil, tagLength: Int, cipherOperation: @escaping CipherOperationOnBlock) {
105+
init(blockSize: Int, nonce: ArraySlice<UInt8>, messageLength: Int, additionalAuthenticatedData: [UInt8]?, expectedTag: Array<UInt8>? = nil, tagLength: Int, cipherOperation: @escaping CipherOperationOnBlock) {
106106
self.blockSize = 16 // CCM is defined for 128 block size
107107
self.tagLength = tagLength
108108
self.additionalBufferSize = tagLength
@@ -236,7 +236,7 @@ class CCMModeWorker: StreamModeWorker, SeekableModeWorker, CounterModeWorker, Fi
236236
// overwrite expectedTag property used later for verification
237237
guard let S0 = try? S(i: 0) else { return ciphertext }
238238
self.expectedTag = xor(ciphertext.suffix(tagLength), S0) as [UInt8]
239-
return ciphertext[ciphertext.startIndex..<ciphertext.endIndex.advanced(by: -Swift.min(tagLength,ciphertext.count))]
239+
return ciphertext[ciphertext.startIndex..<ciphertext.endIndex.advanced(by: -Swift.min(tagLength, ciphertext.count))]
240240
}
241241

242242
func didDecryptLast(bytes plaintext: ArraySlice<UInt8>) throws -> ArraySlice<UInt8> {
@@ -330,7 +330,7 @@ private func format(aad: [UInt8]) -> [UInt8] {
330330
case 65280..<4_294_967_296: // 2^32
331331
// [a]32
332332
return addPadding([0xFF, 0xFE] + a.bytes(totalBytes: 4) + aad, blockSize: 16)
333-
case 4_294_967_296..<pow(2,64): // 2^64
333+
case 4_294_967_296..<pow(2, 64): // 2^64
334334
// [a]64
335335
return addPadding([0xFF, 0xFF] + a.bytes(totalBytes: 8) + aad, blockSize: 16)
336336
default:

Sources/CryptoSwift/BlockMode/GCM.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ final class GCMModeWorker: BlockModeWorker, FinalizingEncryptModeWorker, Finaliz
196196
case .combined:
197197
// overwrite expectedTag property used later for verification
198198
self.expectedTag = Array(ciphertext.suffix(tagLength))
199-
return ciphertext[ciphertext.startIndex..<ciphertext.endIndex.advanced(by: -Swift.min(tagLength,ciphertext.count))]
199+
return ciphertext[ciphertext.startIndex..<ciphertext.endIndex.advanced(by: -Swift.min(tagLength, ciphertext.count))]
200200
case .detached:
201201
return ciphertext
202202
}

Tests/CryptoSwiftTests/AESCCMTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class AESCCMTests: XCTestCase {
2626
let plaintext: Array<UInt8>
2727
let expected: Array<UInt8>
2828

29-
init(_ tagLength: Int, _ key: String, _ nonce: String, _ plaintext: String, _ expected: String, _ aad: String) {
29+
init(_ tagLength: Int, _ key: String, _ nonce: String, _ plaintext: String, _ expected: String, _ aad: String) {
3030
self.tagLength = tagLength
3131
self.key = Array<UInt8>(hex: key)
3232
self.nonce = Array<UInt8>(hex: nonce)
@@ -55,7 +55,7 @@ final class AESCCMTests: XCTestCase {
5555
TestFixture(4, "e1b8a927a95efe94656677b692662000278b441c79e879dd5c0ddc758bdc9ee8", "0545fd9ecbc73ccdbbbd4244fd", "", "5c349fb2", ""),
5656
TestFixture(4, "e1b8a927a95efe94656677b692662000278b441c79e879dd5c0ddc758bdc9ee8", "0a37f2e7c66490e97285f1b09e", "", "c59bf14c", ""),
5757
TestFixture(4, "e1b8a927a95efe94656677b692662000278b441c79e879dd5c0ddc758bdc9ee8", "c1ad812bf2bbb2cdaee4636ee7", "", "5b96f41d", ""),
58-
TestFixture(16, "af063639e66c284083c5cf72b70d8bc277f5978e80d9322d99f2fdc718cda569", "a544218dadd3c10583db49cf39", "","97e1a8dd4259ccd2e431e057b0397fcf", ""),
58+
TestFixture(16, "af063639e66c284083c5cf72b70d8bc277f5978e80d9322d99f2fdc718cda569", "a544218dadd3c10583db49cf39", "", "97e1a8dd4259ccd2e431e057b0397fcf", ""),
5959
TestFixture(16, "af063639e66c284083c5cf72b70d8bc277f5978e80d9322d99f2fdc718cda569", "79ac204a26b9fee1132370c20f", "", "5c8c9a5b97be8c7bc01ca8d693b809f9", ""),
6060
TestFixture(16, "af063639e66c284083c5cf72b70d8bc277f5978e80d9322d99f2fdc718cda569", "0545fd9ecbc73ccdbbbd4244fd", "", "84201662b213c7a1ff0c1b3c25e4ec45", ""),
6161
TestFixture(16, "af063639e66c284083c5cf72b70d8bc277f5978e80d9322d99f2fdc718cda569", "0a37f2e7c66490e97285f1b09e", "", "586e728193ce6db9a926b03b2d77dd6e", ""),
@@ -390,7 +390,7 @@ final class AESCCMTests: XCTestCase {
390390
return true
391391
}
392392

393-
for (i,fixture) in fixtures.enumerated() {
393+
for (i, fixture) in fixtures.enumerated() {
394394
XCTAssertTrue(testEncrypt(fixture: fixture), "Encryption failed")
395395
XCTAssertTrue(testDecrypt(fixture: fixture), "(\(i) - Decryption failed.")
396396
}

0 commit comments

Comments
 (0)