Skip to content

Commit dc7ae43

Browse files
Merge branch 'develop' into develop
2 parents d0520ca + a3b2acf commit dc7ae43

File tree

333 files changed

+15038
-11889
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

333 files changed

+15038
-11889
lines changed

Carthage/Checkouts/CryptoSwift/CryptoSwift.xcworkspace/contents.xcworkspacedata renamed to .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

73a65a1766e605eaeb5d699fcaa8da02

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 4b9283599f7dc904dda099e820226cc1639e6b82

Cartfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github "attaswift/BigInt" ~> 5.0
1+
github "attaswift/BigInt" ~> 5.2.1
22
github "attaswift/SipHash" ~> 1.2.2
3-
github "daltoniam/Starscream" ~> 3.1.0
4-
github "krzyzanowskim/CryptoSwift" ~> 1.0.0
5-
github "mxcl/PromiseKit" ~> 6.8.4
3+
github "daltoniam/Starscream" ~> 4.0.4
4+
github "krzyzanowskim/CryptoSwift" ~> 1.4.0
5+
github "mxcl/PromiseKit" ~> 6.15.3

Cartfile.resolved

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github "attaswift/BigInt" "v5.2.0"
1+
github "attaswift/BigInt" "v5.2.1"
22
github "attaswift/SipHash" "v1.2.2"
3-
github "daltoniam/Starscream" "3.1.1"
4-
github "krzyzanowskim/CryptoSwift" "1.3.2"
5-
github "mxcl/PromiseKit" "6.13.3"
3+
github "daltoniam/Starscream" "4.0.4"
4+
github "krzyzanowskim/CryptoSwift" "1.4.1"
5+
github "mxcl/PromiseKit" "6.15.3"

Carthage/Checkouts/BigInt/BigInt.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Pod::Spec.new do |spec|
33
spec.name = 'BigInt'
4-
spec.version = '5.2.0'
4+
spec.version = '5.2.1'
55
spec.ios.deployment_target = "8.0"
66
spec.osx.deployment_target = "10.9"
77
spec.tvos.deployment_target = "9.0"

Carthage/Checkouts/BigInt/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 5.2.1 (2020-11-15)
2+
3+
This release contains the following changes:
4+
5+
- Added a temporary fix for [SR-13491](https://bugs.swift.org/browse/SR-13491)
6+
17
# 5.2.0 (2020-08-24)
28

39
This release contains the following changes:
Binary file not shown.

Carthage/Checkouts/BigInt/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ The last version with support for Swift 2 was BigInt 1.3.0.)
105105
| 3.x | 2.1.0 |
106106
| 4.0 | 3.1.0 |
107107
| 4.2 | 4.0.0 |
108-
| 5.0 | 5.0.0 |
108+
| 5.x | 5.2.1 |
109109

110110
BigInt deploys to macOS 10.10, iOS 9, watchOS 2 and tvOS 9.
111111
It has been tested on the latest OS releases only---however, as the module uses very few platform-provided APIs,
@@ -121,19 +121,19 @@ Setup instructions:
121121
Add this to the dependency section of your `Package.swift` manifest:
122122

123123
```Swift
124-
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.0.0")
124+
.package(url: "https://github.com/attaswift/BigInt.git", from: "5.2.1")
125125
```
126126

127127
- **CocoaPods:** Put this in your `Podfile`:
128128

129129
```Ruby
130-
pod 'BigInt', '~> 5.0'
130+
pod 'BigInt', '~> 5.2'
131131
```
132132

133133
- **Carthage:** Put this in your `Cartfile`:
134134

135135
```
136-
github "attaswift/BigInt" ~> 5.0
136+
github "attaswift/BigInt" ~> 5.2
137137
```
138138

139139
## <a name="notes">Implementation notes</a>

Carthage/Checkouts/BigInt/Sources/Division.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88

99
//MARK: Full-width multiplication and division
1010

11-
extension FixedWidthInteger where Magnitude == Self {
11+
// TODO: Return to `where Magnitude == Self` when SR-13491 is resolved
12+
extension FixedWidthInteger {
1213
private var halfShift: Self {
1314
return Self(Self.bitWidth / 2)
1415

@@ -91,13 +92,13 @@ extension FixedWidthInteger where Magnitude == Self {
9192
let w = Self(Self.bitWidth) - z
9293
let vn = self << z
9394

94-
let un32 = (z == 0 ? dividend.high : (dividend.high &<< z) | (dividend.low &>> w)) // No bits are lost
95+
let un32 = (z == 0 ? dividend.high : (dividend.high &<< z) | ((dividend.low as! Self) &>> w)) // No bits are lost
9596
let un10 = dividend.low &<< z
9697
let (un1, un0) = un10.split
9798

9899
// Divide `(un32,un10)` by `vn`, splitting the full 4/2 division into two 3/2 ones.
99-
let (q1, un21) = quotientAndRemainder(dividing: (un32, un1), by: vn)
100-
let (q0, rn) = quotientAndRemainder(dividing: (un21, un0), by: vn)
100+
let (q1, un21) = quotientAndRemainder(dividing: (un32, (un1 as! Self)), by: vn)
101+
let (q0, rn) = quotientAndRemainder(dividing: (un21, (un0 as! Self)), by: vn)
101102

102103
// Undo normalization of the remainder and combine the two halves of the quotient.
103104
let mod = rn >> z
@@ -120,7 +121,7 @@ extension FixedWidthInteger where Magnitude == Self {
120121
r = s
121122
}
122123
else {
123-
(q, r) = y.0.fastDividingFullWidth((x.0, x.1))
124+
(q, r) = y.0.fastDividingFullWidth((x.0, (x.1 as! Magnitude)))
124125
}
125126
// Now refine q by considering x.2 and y.1.
126127
// Note that since y is normalized, q * y - x is between 0 and 2.
@@ -130,7 +131,7 @@ extension FixedWidthInteger where Magnitude == Self {
130131
let (r1, ro) = r.addingReportingOverflow(y.0)
131132
if ro { return q - 1 }
132133

133-
let (pl1, so) = pl.subtractingReportingOverflow(y.1)
134+
let (pl1, so) = pl.subtractingReportingOverflow((y.1 as! Magnitude))
134135
let ph1 = (so ? ph - 1 : ph)
135136

136137
if ph1 < r1 || (ph1 == r1 && pl1 <= x.2) { return q - 1 }

Carthage/Checkouts/BigInt/Tests/BigIntTests/WordTests.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
import XCTest
1010
@testable import BigInt
1111

12-
struct TestDivision<Word: FixedWidthInteger> where Word.Magnitude == Word {
12+
// TODO: Return to `where Word.Magnitude == Word` when SR-13491 is resolved
13+
struct TestDivision<Word: FixedWidthInteger> {
1314
static func testDivision(_ u: (high: Word, low: Word.Magnitude), _ v: Word) {
1415
let (div, mod) = v.fastDividingFullWidth(u)
1516
var (ph, pl) = div.multipliedFullWidth(by: v)
16-
let (s, o) = pl.addingReportingOverflow(mod)
17+
let (s, o) = pl.addingReportingOverflow((mod as! Word.Magnitude))
1718
pl = s
1819
if o { ph += Word(1) }
1920

0 commit comments

Comments
 (0)