You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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."
> 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
44
68
45
69
### Try it out
46
70
@@ -84,7 +108,7 @@ var messageDigest = try! "7E2D58D8B3BCDF1ABADEC7829054F90DDA9805AAB56C77333024B9
84
108
let signature =try! privateKey.signature(message: &messageDigest, auxiliaryRand: &auxRand)
85
109
```
86
110
87
-
## Tweak
111
+
###Tweak
88
112
89
113
```swift
90
114
let privateKey =try! P256K.Signing.PrivateKey()
@@ -95,7 +119,7 @@ let tweakedPrivateKey = try! privateKey.add(tweak)
95
119
let tweakedPublicKeyKey =try! privateKey.publicKey.add(tweak)
96
120
```
97
121
98
-
## Elliptic Curve Diffie Hellman
122
+
###Elliptic Curve Diffie Hellman
99
123
100
124
```swift
101
125
let privateKey =try! P256K.KeyAgreement.PrivateKey()
@@ -108,7 +132,7 @@ let sharedSecret = try! privateKey.sharedSecretFromKeyAgreement(with: publicKey,
108
132
let symmetricKey = SHA256.hash(data: sharedSecret.bytes)
109
133
```
110
134
111
-
## Silent Payments Scheme
135
+
###Silent Payments Scheme
112
136
113
137
```swift
114
138
let privateSign1 =try! P256K.Signing.PrivateKey()
@@ -135,7 +159,7 @@ let schnorrPrivate = try! P256K.Schnorr.PrivateKey(dataRepresentation: sharedSec
135
159
let xonlyTweak2 =try! schnorrPrivate.xonly.add(privateSign1.publicKey.xonly.bytes)
0 commit comments