Skip to content

Commit c6eb470

Browse files
committed
carthage update --use-xcframeworks
1 parent cfe9a7d commit c6eb470

File tree

15 files changed

+127
-25
lines changed

15 files changed

+127
-25
lines changed

Cartfile.resolved

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
github "attaswift/BigInt" "v5.2.1"
22
github "attaswift/SipHash" "v1.2.2"
33
github "daltoniam/Starscream" "4.0.4"
4-
github "krzyzanowskim/CryptoSwift" "1.4.0"
4+
github "krzyzanowskim/CryptoSwift" "1.4.1"
55
github "mxcl/PromiseKit" "6.15.3"

Carthage/Checkouts/CryptoSwift/.github/workflows/linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-18.04
12+
runs-on: ubuntu-20.04
1313

1414
steps:
1515
- uses: actions/checkout@v2

Carthage/Checkouts/CryptoSwift/CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
1.4.1
2+
- Introduce ISO 10126 padding
3+
- fix various compiler warnings
4+
- Revert Xcode project deployment target
5+
16
1.4.0
27
- Customize CFB segment size (cfb8, cfb128).
38
- Adapt Swift @inlineable for better code optimization

Carthage/Checkouts/CryptoSwift/CONTRIBUTORS.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ organizations who have contributed source code to CryptoSwift.
2828
- Chris Amanse <[email protected]>
2929
- Christian Steffens <[email protected]>
3030
- Cihat Gündüz <[email protected]>
31+
- Cosmin Baies <[email protected]>
3132
- Dave Wood <[email protected]>
3233
- Dima Kalachov <[email protected]>
3334
- Dusan Klinec <[email protected]>
3435
- Eneko Alonso <[email protected]>
36+
- Eugene Berdnikov <[email protected]>
3537
- Evan Maloney <[email protected]>
3638
- Evin Ugur <[email protected]>
3739
- Frank Langel <[email protected]>
@@ -47,6 +49,7 @@ organizations who have contributed source code to CryptoSwift.
4749
- Javier Soto <[email protected]>
4850
- Jeremy Greenwood <[email protected]>
4951
- John Hammerlund <[email protected]>
52+
- Jonas Obrist <[email protected]>
5053
- K.K. POON <[email protected]>
5154
- Keith Smiley <[email protected]>
5255
- Koray Koska <[email protected]>

Carthage/Checkouts/CryptoSwift/CryptoSwift.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
Pod::Spec.new do |s|
22
s.name = "CryptoSwift"
3-
s.version = "1.4.0"
3+
s.version = "1.4.1"
44
s.source = { :git => "https://github.com/krzyzanowskim/CryptoSwift.git", :tag => "#{s.version}" }
55
s.summary = "Cryptography in Swift. SHA, MD5, CRC, PBKDF, Poly1305, HMAC, CMAC, HDKF, Scrypt, ChaCha20, Rabbit, Blowfish, AES."
66
s.description = "Cryptography functions and helpers for Swift implemented in Swift. SHA-1, SHA-2, SHA-3, MD5, PBKDF1, PBKDF2, Scrypt, CRC, Poly1305, HMAC, ChaCha20, Rabbit, Blowfish, AES"
77
s.homepage = "https://github.com/krzyzanowskim/CryptoSwift"
88
s.license = {:type => "Attribution", :file => "LICENSE"}
99
s.authors = {'Marcin Krzyżanowski' => '[email protected]'}
1010
s.social_media_url = "https://twitter.com/krzyzanowskim"
11-
s.cocoapods_version = '>= 1.9.1'
11+
s.cocoapods_version = '>= 1.10.0'
1212
s.swift_version = "5.3"
1313
s.ios.deployment_target = "9.0"
1414
s.osx.deployment_target = "10.12"

Carthage/Checkouts/CryptoSwift/CryptoSwift.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
14156CE52011422400DDCFBC /* ChaCha20Poly1305Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14156CE42011422400DDCFBC /* ChaCha20Poly1305Tests.swift */; };
1414
1467460F2017BB3600DF04ED /* AEAD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1467460E2017BB3600DF04ED /* AEAD.swift */; };
1515
35F3E51C23BF9A6700A024A1 /* OCB.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35F3E51B23BF9A6700A024A1 /* OCB.swift */; };
16+
42012783267A6F1C00F82506 /* ISO10126Padding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 42012782267A6F1C00F82506 /* ISO10126Padding.swift */; };
1617
674A736F1BF5D85B00866C5B /* RabbitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 674A736E1BF5D85B00866C5B /* RabbitTests.swift */; };
1718
750509991F6BEF2A00394A1B /* PKCS7.swift in Sources */ = {isa = PBXBuildFile; fileRef = 750509981F6BEF2A00394A1B /* PKCS7.swift */; };
1819
750CC3EB1DC0CACE0096BE6E /* BlowfishTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 750CC3EA1DC0CACE0096BE6E /* BlowfishTests.swift */; };
@@ -204,6 +205,7 @@
204205
1467460E2017BB3600DF04ED /* AEAD.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AEAD.swift; sourceTree = "<group>"; };
205206
35F3E51B23BF9A6700A024A1 /* OCB.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OCB.swift; sourceTree = "<group>"; };
206207
35F3E51D23BF9AD300A024A1 /* AESOCBTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AESOCBTests.swift; sourceTree = "<group>"; };
208+
42012782267A6F1C00F82506 /* ISO10126Padding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ISO10126Padding.swift; sourceTree = "<group>"; };
207209
674A736E1BF5D85B00866C5B /* RabbitTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RabbitTests.swift; sourceTree = "<group>"; };
208210
750509981F6BEF2A00394A1B /* PKCS7.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PKCS7.swift; sourceTree = "<group>"; };
209211
750CC3EA1DC0CACE0096BE6E /* BlowfishTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlowfishTests.swift; sourceTree = "<group>"; };
@@ -509,6 +511,7 @@
509511
isa = PBXGroup;
510512
children = (
511513
0AF023D4230F2B0F008E4E68 /* ISO78164Padding.swift */,
514+
42012782267A6F1C00F82506 /* ISO10126Padding.swift */,
512515
7529366820683DFC00195874 /* AEAD */,
513516
75EC52381EE8B6CA0048EB3B /* AES.swift */,
514517
751EE9771F93996100161FFC /* AES.Cryptors.swift */,
@@ -831,6 +834,7 @@
831834
isa = PBXSourcesBuildPhase;
832835
buildActionMask = 2147483647;
833836
files = (
837+
42012783267A6F1C00F82506 /* ISO10126Padding.swift in Sources */,
834838
0AF023D5230F2B0F008E4E68 /* ISO78164Padding.swift in Sources */,
835839
75EC52861EE8B8170048EB3B /* CFB.swift in Sources */,
836840
75EC52901EE8B81A0048EB3B /* Collection+Extension.swift in Sources */,

Carthage/Checkouts/CryptoSwift/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ Good mood
3636
#### Hash (Digest)
3737
[MD5](http://tools.ietf.org/html/rfc1321)
3838
| [SHA1](http://tools.ietf.org/html/rfc3174)
39-
| [SHA224](http://tools.ietf.org/html/rfc6234)
40-
| [SHA256](http://tools.ietf.org/html/rfc6234)
41-
| [SHA384](http://tools.ietf.org/html/rfc6234)
42-
| [SHA512](http://tools.ietf.org/html/rfc6234)
39+
| [SHA2-224](http://tools.ietf.org/html/rfc6234)
40+
| [SHA2-256](http://tools.ietf.org/html/rfc6234)
41+
| [SHA2-384](http://tools.ietf.org/html/rfc6234)
42+
| [SHA2-512](http://tools.ietf.org/html/rfc6234)
4343
| [SHA3](http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf)
4444

4545
#### Cyclic Redundancy Check (CRC)
@@ -81,6 +81,7 @@ Good mood
8181
| [PKCS#7](http://tools.ietf.org/html/rfc5652#section-6.3)
8282
| [Zero padding](https://en.wikipedia.org/wiki/Padding_(cryptography)#Zero_padding)
8383
| [ISO78164](http://www.embedx.com/pdfs/ISO_STD_7816/info_isoiec7816-4%7Bed21.0%7Den.pdf)
84+
| [ISO10126](https://en.wikipedia.org/wiki/Padding_(cryptography)#ISO_10126)
8485
| No padding
8586

8687
#### Authenticated Encryption with Associated Data (AEAD)
@@ -121,7 +122,7 @@ It is recommended to enable [Whole-Module Optimization](https://swift.org/blog/w
121122
You can use [Swift Package Manager](https://swift.org/package-manager/) and specify dependency in `Package.swift` by adding this:
122123

123124
```swift
124-
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMinor(from: "1.4.0"))
125+
.package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", .upToNextMajor(from: "1.4.1"))
125126
```
126127

127128
See: [Package.swift - manual](http://blog.krzyzanowskim.com/2016/08/09/package-swift-manual/)
@@ -133,7 +134,7 @@ Notice: Swift Package Manager uses debug configuration for debug Xcode build, th
133134
You can use [CocoaPods](https://cocoapods.org/pods/CryptoSwift).
134135

135136
```ruby
136-
pod 'CryptoSwift', '~> 1.4.0'
137+
pod 'CryptoSwift', '~> 1.4.1'
137138
```
138139

139140
Bear in mind that CocoaPods will build CryptoSwift without [Whole-Module Optimization](https://swift.org/blog/whole-module-optimizations/) that may impact performance. You can change it manually after installation, or use [cocoapods-wholemodule](https://github.com/jedlewison/cocoapods-wholemodule) plugin.

Carthage/Checkouts/CryptoSwift/Sources/CryptoSwift/Foundation/Array+Foundation.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import Foundation
1717

1818
public extension Array where Element == UInt8 {
19-
func toBase64() -> String? {
20-
Data( self).base64EncodedString()
19+
func toBase64() -> String {
20+
Data(self).base64EncodedString()
2121
}
2222

2323
init(base64: String) {
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
//
2+
// CryptoSwift
3+
//
4+
// Copyright (C) Marcin Krzyżanowski <[email protected]>
5+
// This software is provided 'as-is', without any express or implied warranty.
6+
//
7+
// In no event will the authors be held liable for any damages arising from the use of this software.
8+
//
9+
// Permission is granted to anyone to use this software for any purpose,including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:
10+
//
11+
// - The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation is required.
12+
// - Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13+
// - This notice may not be removed or altered from any source or binary distribution.
14+
//
15+
16+
import Foundation
17+
18+
/// Padding with random bytes, ending with the number of added bytes.
19+
/// Read the [Wikipedia](https://en.wikipedia.org/wiki/Padding_(cryptography)#ISO_10126)
20+
/// and [Crypto-IT](http://www.crypto-it.net/eng/theory/padding.html) articles for more info.
21+
struct ISO10126Padding: PaddingProtocol {
22+
init() {
23+
}
24+
25+
@inlinable
26+
func add(to bytes: Array<UInt8>, blockSize: Int) -> Array<UInt8> {
27+
let padding = UInt8(blockSize - (bytes.count % blockSize))
28+
var withPadding = bytes
29+
if padding > 0 {
30+
withPadding += (0..<(padding - 1)).map { _ in UInt8.random(in: 0...255) } + [padding]
31+
}
32+
return withPadding
33+
}
34+
35+
@inlinable
36+
func remove(from bytes: Array<UInt8>, blockSize: Int?) -> Array<UInt8> {
37+
guard !bytes.isEmpty, let lastByte = bytes.last else {
38+
return bytes
39+
}
40+
41+
assert(!bytes.isEmpty, "Need bytes to remove padding")
42+
43+
let padding = Int(lastByte) // last byte
44+
let finalLength = bytes.count - padding
45+
46+
if finalLength < 0 {
47+
return bytes
48+
}
49+
50+
if padding >= 1 {
51+
return Array(bytes[0..<finalLength])
52+
}
53+
54+
return bytes
55+
}
56+
}

Carthage/Checkouts/CryptoSwift/Sources/CryptoSwift/Padding.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public protocol PaddingProtocol {
1919
}
2020

2121
public enum Padding: PaddingProtocol {
22-
case noPadding, zeroPadding, pkcs7, pkcs5, iso78164
22+
case noPadding, zeroPadding, pkcs7, pkcs5, iso78164, iso10126
2323

2424
public func add(to: Array<UInt8>, blockSize: Int) -> Array<UInt8> {
2525
switch self {
@@ -33,6 +33,8 @@ public enum Padding: PaddingProtocol {
3333
return PKCS5.Padding().add(to: to, blockSize: blockSize)
3434
case .iso78164:
3535
return ISO78164Padding().add(to: to, blockSize: blockSize)
36+
case .iso10126:
37+
return ISO10126Padding().add(to: to, blockSize: blockSize)
3638
}
3739
}
3840

@@ -48,6 +50,8 @@ public enum Padding: PaddingProtocol {
4850
return PKCS5.Padding().remove(from: from, blockSize: blockSize)
4951
case .iso78164:
5052
return ISO78164Padding().remove(from: from, blockSize: blockSize)
53+
case .iso10126:
54+
return ISO10126Padding().remove(from: from, blockSize: blockSize)
5155
}
5256
}
5357
}

0 commit comments

Comments
 (0)