Skip to content

Commit

Permalink
Added TomCrypt as a Swift Package. Lots taken from libtom/libtomcryp…
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSouthgate committed Jun 18, 2023
0 parents commit 1ed21d7
Show file tree
Hide file tree
Showing 9 changed files with 353 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/xcuserdata/*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vendor"]
path = vendor
url = [email protected]:libtom/libtomcrypt.git
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Headers/module.modulemap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module TomCrypt [extern_c] {
header "tomcrypt.h"
export *
}
1 change: 1 addition & 0 deletions Headers/tomcrypt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../vendor/src/headers/tomcrypt.h"
16 changes: 16 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"object": {
"pins": [
{
"package": "TomMath",
"repositoryURL": "https://github.com/DavidSouthgate/TomMathSPM.git",
"state": {
"branch": "main",
"revision": "d14f446ea2f0de6cf9d907f408a50133ed53bdd9",
"version": null
}
}
]
},
"version": 1
}
42 changes: 42 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// swift-tools-version:5.0
import PackageDescription

let package = Package(
name: "TomCrypt",
platforms: [
.macOS(.v10_10), .iOS(.v9), .tvOS(.v9), .watchOS(.v4)
],
products: [
.library(
name: "TomCrypt",
targets: [ "TomCrypt" ])
],
dependencies: [
.package(url: "https://github.com/DavidSouthgate/TomMathSPM.git", .branchItem("main"))
],
targets: [
.target(name: "TomCrypt",
dependencies: [
.product(name: "TomMath", package: "TomMathSPM")
],
path: ".",
sources: [
"vendor/src"
],
publicHeadersPath: "Headers",
cSettings: [
.headerSearchPath("vendor/src/headers"),
.define("USE_LTM"),
.define("LTM_DESC"),
.define("LTC_NO_TEST"),
.unsafeFlags(["-flto=thin"]) // for Dead Code Elimination
]),
.testTarget(name: "TomCryptTests",
dependencies: [
"TomCrypt"
],
path: "Tests")
],
cLanguageStandard: .gnu11,
cxxLanguageStandard: .gnucxx14
)
278 changes: 278 additions & 0 deletions Tests/TomCryptTests.swift

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions vendor
Submodule vendor added at fae62a

0 comments on commit 1ed21d7

Please sign in to comment.