Skip to content

Commit 0141a8e

Browse files
committed
Adding license files
1 parent 6dfd5bf commit 0141a8e

File tree

4 files changed

+83
-17
lines changed

4 files changed

+83
-17
lines changed

.github/workflows/xcframework-release.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
3-
41
name: XCFramework Release
52
on:
63
release:
@@ -35,7 +32,8 @@ jobs:
3532
"tvOS Simulator"
3633
"watchOS"
3734
"watchOS Simulator"
38-
"visionOS"
35+
# "visionOS"
36+
# "XR Simulator"
3937
)
4038
4139
# Loop over platforms and archive for each one
@@ -101,7 +99,8 @@ jobs:
10199
-e 's/[[:<:]]P256K\.PrivateKeyImplementation[[:>:]]/PrivateKeyImplementation/g'
102100
- name: 7z XCFramework
103101
run: |
104-
7z a -tzip -mx=9 P256K.xcframework.zip P256K.xcframework
102+
# Create zip with maximum compression including license files alongside the XCFramework
103+
7z a -tzip -mx=9 P256K.xcframework.zip P256K.xcframework LICENSE "Submodules/secp256k1/COPYING"
105104
- name: Upload XCFramework
106105
run: |
107106
gh release upload ${{ github.ref_name }} P256K.xcframework.zip

Projects/swift-secp256k1.podspec

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Pod::Spec.new do |s|
2+
3+
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
4+
5+
s.name = "swift-secp256k1"
6+
s.version = "0.20.0-prerelease-0"
7+
s.summary = "P256K: Elliptic curve public key cryptography, ECDH, and Schnorr Signatures for Bitcoin."
8+
s.description = "Open-source library for a substantial portion of the APIs of libsecp256k1. Written in Swift for native iOS, macOS, tvOS, watchOS, and visionOS."
9+
s.homepage = "https://github.com/21-DOT-DEV/swift-secp256k1"
10+
11+
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
12+
13+
s.license = { :type => "MIT", :file => "LICENSE" }
14+
15+
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
16+
17+
s.author = { "21-DOT-DEV" => "[email protected]" }
18+
s.social_media_url = "https://primal.net/21"
19+
20+
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
21+
22+
s.ios.deployment_target = "18.0"
23+
s.osx.deployment_target = "15.0"
24+
s.tvos.deployment_target = "18.0"
25+
s.watchos.deployment_target = "11.0"
26+
#s.visionos.deployment_target = "2.0"
27+
28+
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
29+
30+
s.source = {
31+
:http => "https://github.com/21-DOT-DEV/swift-secp256k1/releases/download/#{s.version}/P256K.xcframework.zip",
32+
:sha256 => "286b82ffcade89092c536e669b44b84d2726229e9f54e56cd6fa86323f2e1f09"
33+
}
34+
35+
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
36+
37+
s.requires_arc = true
38+
s.module_name = "P256K"
39+
s.swift_version = "6.0"
40+
s.vendored_frameworks = "P256K.xcframework"
41+
42+
end

README.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Swift package for elliptic curve public key cryptography, ECDSA, and Schnorr Sig
1717

1818
This package uses Swift Package Manager. To add it to your project:
1919

20+
> [!WARNING]
21+
> These APIs are not considered stable and may change with any update. Specify a version using `exact:` to avoid breaking changes.
22+
2023
### Using Xcode
2124

2225
1. Go to `File > Add Packages...`
@@ -28,19 +31,40 @@ This package uses Swift Package Manager. To add it to your project:
2831
Add the following to your `Package.swift` file:
2932

3033
```swift
31-
.package(name: "swift-secp256k1", url: "https://github.com/21-DOT-DEV/swift-secp256k1", exact: "0.19.0"),
34+
.package(name: "swift-secp256k1", url: "https://github.com/21-DOT-DEV/swift-secp256k1", exact: "0.20.0"),
3235
```
3336

34-
Then, include `secp256k1` as a dependency in your target:
37+
Then, include `P256K` as a dependency in your target:
3538

3639
```swift
3740
.target(name: "<target>", dependencies: [
3841
.product(name: "P256K", package: "swift-secp256k1")
3942
]),
4043
```
4144

42-
> [!WARNING]
43-
> These APIs are not considered stable and may change with any update. Specify a version using `exact:` to avoid breaking changes.
45+
### Using CocoaPods
46+
47+
Add the following to your `Podfile`:
48+
49+
```ruby
50+
pod 'swift-secp256k1', '0.20.0'
51+
```
52+
53+
54+
### Swift versions
55+
56+
The most recent versions of swift-secp256k1 support Swift 6.0 and newer. The minimum Swift version supported by swift-secp256k1 releases are detailed below:
57+
58+
swift-secp256k1 | Minimum Swift Version
59+
------------------|----------------------
60+
`2.0.0 ..< 2.1.0` | 5.2
61+
`2.1.0 ..< 2.2.0` | 5.4
62+
`2.2.0 ..< 2.4.2` | 5.5
63+
`2.4.2 ..< 3.1.0` | 5.6
64+
`3.1.0 ..< 3.3.0` | 5.7
65+
`3.3.0 ..< 3.8.0` | 5.8
66+
`3.8.0 ...` | 5.9
67+
`0.20.0 ...` | 6.0
4468

4569
### Try it out
4670

@@ -84,7 +108,7 @@ var messageDigest = try! "7E2D58D8B3BCDF1ABADEC7829054F90DDA9805AAB56C77333024B9
84108
let signature = try! privateKey.signature(message: &messageDigest, auxiliaryRand: &auxRand)
85109
```
86110

87-
## Tweak
111+
### Tweak
88112

89113
```swift
90114
let privateKey = try! P256K.Signing.PrivateKey()
@@ -95,7 +119,7 @@ let tweakedPrivateKey = try! privateKey.add(tweak)
95119
let tweakedPublicKeyKey = try! privateKey.publicKey.add(tweak)
96120
```
97121

98-
## Elliptic Curve Diffie Hellman
122+
### Elliptic Curve Diffie Hellman
99123

100124
```swift
101125
let privateKey = try! P256K.KeyAgreement.PrivateKey()
@@ -108,7 +132,7 @@ let sharedSecret = try! privateKey.sharedSecretFromKeyAgreement(with: publicKey,
108132
let symmetricKey = SHA256.hash(data: sharedSecret.bytes)
109133
```
110134

111-
## Silent Payments Scheme
135+
### Silent Payments Scheme
112136

113137
```swift
114138
let privateSign1 = try! P256K.Signing.PrivateKey()
@@ -135,7 +159,7 @@ let schnorrPrivate = try! P256K.Schnorr.PrivateKey(dataRepresentation: sharedSec
135159
let xonlyTweak2 = try! schnorrPrivate.xonly.add(privateSign1.publicKey.xonly.bytes)
136160
```
137161

138-
## Recovery
162+
### Recovery
139163

140164
```swift
141165
let privateKey = try! P256K.Recovery.PrivateKey()
@@ -151,7 +175,7 @@ let publicKey = try! P256K.Recovery.PublicKey(messageData, signature: recoverySi
151175
let signature = try! recoverySignature.normalize
152176
```
153177

154-
## Combine Public Keys
178+
### Combine Public Keys
155179

156180
```swift
157181
let privateKey = try! P256K.Signing.PrivateKey()
@@ -161,7 +185,7 @@ let publicKey = try! P256K.Signing.PrivateKey().public
161185
publicKey.combine([privateKey.publicKey], format: .uncompressed)
162186
```
163187

164-
## PEM Key Format
188+
### PEM Key Format
165189

166190
```swift
167191
let privateKeyString = """
@@ -176,7 +200,7 @@ oUQDQgAEt2uDn+2GqqYs/fmkBr5+rCQ3oiFSIJMAcjHIrTDS6HEELgguOatmFBOp
176200
let privateKey = try! P256K.Signing.PrivateKey(pemRepresentation: privateKeyString)
177201
```
178202

179-
## MuSig2
203+
### MuSig2
180204

181205
```swift
182206
// Initialize private keys for two signers

bitrise.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ workflows:
119119
"tvOS Simulator"
120120
"watchOS"
121121
"watchOS Simulator"
122-
# "visionOS"
122+
# "visionOS"
123+
# "XR Simulator"
123124
)
124125
125126
# Loop over platforms and archive for each one

0 commit comments

Comments
 (0)