-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c6e4e52
Showing
59 changed files
with
17,703 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.DS_Store | ||
/.build | ||
/Packages | ||
/*.xcodeproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// swift-tools-version:5.0 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "BigInt", | ||
products: [ | ||
// Products define the executables and libraries produced by a package, and make them visible to other packages. | ||
.library( | ||
name: "BigInt", | ||
targets: ["BigInt"]), | ||
], | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
// .package(url: /* package url */, from: "1.0.0"), | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages which this package depends on. | ||
.target( | ||
name: "BigInt", | ||
dependencies: []), | ||
.testTarget( | ||
name: "BigIntTests", | ||
dependencies: ["BigInt"]), | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<h3><b>Description</b></h3> | ||
|
||
The BigInt package provides arbitrary-precision integer arithmetic in Swift. | ||
It contains functionality comparable to that of the Java BigInteger class. | ||
|
||
BigInt requires Swift 5.0. | ||
|
||
|
||
<h3><b>Usage</b></h3> | ||
Using Swift Package Manager, in your projects Package.swift file add a dependency like<br> | ||
``` | ||
dependencies: [ | ||
// Dependencies declare other packages that this package depends on. | ||
.package(url: "https://github.com/leif-ibsen/BigInt", from: "1.0.0"), | ||
], | ||
``` | ||
|
||
<h3><b>References</b></h3> | ||
|
||
Algorithms from the following books have been used in the implementation. | ||
There are references in the source code where appropriate. | ||
|
||
<ul> | ||
<li>Donald E. Knuth: Seminumerical Algorithms. Addison-Wesley 1971</li> | ||
<li>Crandall and Pomerance: Prime Numbers - A Computational Perspective. Second Edition, Springer 2005</li> | ||
<li>Henry S. Warren, Jr: Hacker's Delight. Second Edition, Addison-Wesley 2013</li> | ||
<li>Menezes, Oorschot, Vanstone: Handbook of Applied Cryptography. CRC Press 1996</li> | ||
</ul> | ||
|
||
|
||
<h3><b>Acknowledgement</b></h3> | ||
|
||
The BitSieve class used in the implementation is a translation to Swift of the corresponding class from Java BigInteger. | ||
The GCD algorithm and the Karatsuba and ToomCook multiplication algorithms are modelled after the corresponding algorithms in Java BigInteger. | ||
|
Oops, something went wrong.