Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
leif-ibsen committed Sep 17, 2019
0 parents commit c6e4e52
Show file tree
Hide file tree
Showing 59 changed files with 17,703 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
28 changes: 28 additions & 0 deletions Package.swift
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"]),
]
)
35 changes: 35 additions & 0 deletions README.md
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.

Loading

0 comments on commit c6e4e52

Please sign in to comment.