forked from 21-DOT-DEV/swift-secp256k1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
95 lines (91 loc) · 3.11 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// swift-tools-version:5.6
import PackageDescription
let dependencies: [Package.Dependency]
#if os(macOS)
dependencies = [
// Dependencies used for package development
.package(url: "https://github.com/csjones/lefthook.git", branch: "swift"),
.package(url: "https://github.com/nicklockwood/SwiftFormat.git", from: "0.49.5"),
.package(url: "https://github.com/realm/SwiftLint.git", exact: "0.46.5"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")
]
#else
dependencies = []
#endif
let package = Package(
name: "secp256k1",
products: [
// WARNING: These APIs should not be considered stable and may change at any time.
.library(
name: "secp256k1",
targets: [
"secp256k1"
]
),
.library(
name: "zkp",
targets: [
"zkp"
]
)
],
dependencies: dependencies,
targets: [
.target(
name: "secp256k1",
dependencies: [
"secp256k1_bindings"
]
),
.target(
name: "zkp",
dependencies: [
"zkp_bindings"
]
),
.target(
name: "secp256k1_bindings",
cSettings: [
// Basic config values that are universal and require no dependencies.
.define("ECMULT_GEN_PREC_BITS", to: "4"),
.define("ECMULT_WINDOW_SIZE", to: "15"),
// Enabling additional secp256k1 modules.
.define("ENABLE_MODULE_ECDH"),
.define("ENABLE_MODULE_EXTRAKEYS"),
.define("ENABLE_MODULE_RECOVERY"),
.define("ENABLE_MODULE_SCHNORRSIG")
]
),
.target(
name: "zkp_bindings",
cSettings: [
// Basic config values that are universal and require no dependencies.
.define("ECMULT_GEN_PREC_BITS", to: "4"),
.define("ECMULT_WINDOW_SIZE", to: "15"),
// Enabling additional secp256k1-zkp modules.
.define("ENABLE_MODULE_ECDH"),
.define("ENABLE_MODULE_ECDSA_ADAPTOR"),
.define("ENABLE_MODULE_ECDSA_S2C"),
.define("ENABLE_MODULE_EXTRAKEYS"),
.define("ENABLE_MODULE_GENERATOR"),
.define("ENABLE_MODULE_MUSIG"),
.define("ENABLE_MODULE_RANGEPROOF"),
.define("ENABLE_MODULE_RECOVERY"),
.define("ENABLE_MODULE_SCHNORRSIG"),
.define("ENABLE_MODULE_SURJECTIONPROOF"),
.define("ENABLE_MODULE_WHITELIST"),
// Some modules need additional header search paths
.headerSearchPath("../../Submodules/secp256k1-zkp"),
.headerSearchPath("../../Submodules/secp256k1-zkp/src")
]
),
.testTarget(
name: "zkpTests",
dependencies: [
"zkp"
]
)
],
swiftLanguageVersions: [.v5],
cLanguageStandard: .c89
)