|
4 | 4 |
|
5 | 5 | import Foundation |
6 | 6 |
|
| 7 | +// swiftlint:disable all |
| 8 | + |
7 | 9 | extension K1.KeyAgreement { |
8 | 10 | // MARK: KeyAgreement + PrivateKey |
9 | 11 | /// A `secp256k1` private key used for key agreement. |
@@ -201,25 +203,25 @@ extension K1.KeyAgreement { |
201 | 203 | } |
202 | 204 |
|
203 | 205 | // MARK: Group Operations |
204 | | - |
| 206 | + |
205 | 207 | /// Adds two public keys (points) on the secp256k1 curve |
206 | 208 | public static func + (lhs: Self, rhs: Self) throws -> Self { |
207 | 209 | try Self(impl: lhs.impl + rhs.impl) |
208 | 210 | } |
209 | | - |
| 211 | + |
210 | 212 | /// Subtracts two public keys (points) on the secp256k1 curve |
211 | 213 | public static func - (lhs: Self, rhs: Self) throws -> Self { |
212 | 214 | try Self(impl: lhs.impl - rhs.impl) |
213 | 215 | } |
214 | | - |
| 216 | + |
215 | 217 | /// Negates a public key (point) on the secp256k1 curve |
216 | 218 | public func negate() throws -> Self { |
217 | 219 | try Self(impl: impl.negate()) |
218 | 220 | } |
219 | | - |
| 221 | + |
220 | 222 | /// Combines multiple public keys (points) on the secp256k1 curve |
221 | 223 | public static func sum(keys: [Self]) throws -> Self { |
222 | | - let impls = keys.map { $0.impl } |
| 224 | + let impls = keys.map(\.impl) |
223 | 225 | return try Self(impl: K1._PublicKeyImplementation.sum(keys: impls)) |
224 | 226 | } |
225 | 227 | } |
@@ -442,7 +444,7 @@ extension K1.Schnorr { |
442 | 444 |
|
443 | 445 | /// Combines multiple public keys (points) on the secp256k1 curve |
444 | 446 | public static func sum(keys: [Self]) throws -> Self { |
445 | | - let impls = keys.map { $0.impl } |
| 447 | + let impls = keys.map(\.impl) |
446 | 448 | return try Self(impl: K1._PublicKeyImplementation.sum(keys: impls)) |
447 | 449 | } |
448 | 450 | } |
@@ -665,7 +667,7 @@ extension K1.ECDSA { |
665 | 667 |
|
666 | 668 | /// Combines multiple public keys (points) on the secp256k1 curve |
667 | 669 | public static func sum(keys: [Self]) throws -> Self { |
668 | | - let impls = keys.map { $0.impl } |
| 670 | + let impls = keys.map(\.impl) |
669 | 671 | return try Self(impl: K1._PublicKeyImplementation.sum(keys: impls)) |
670 | 672 | } |
671 | 673 | } |
@@ -888,7 +890,7 @@ extension K1.ECDSAWithKeyRecovery { |
888 | 890 |
|
889 | 891 | /// Combines multiple public keys (points) on the secp256k1 curve |
890 | 892 | public static func sum(keys: [Self]) throws -> Self { |
891 | | - let impls = keys.map { $0.impl } |
| 893 | + let impls = keys.map(\.impl) |
892 | 894 | return try Self(impl: K1._PublicKeyImplementation.sum(keys: impls)) |
893 | 895 | } |
894 | 896 | } |
@@ -917,3 +919,5 @@ extension K1.ECDSAWithKeyRecovery.PrivateKey: _K1PrivateKeyProtocol {} |
917 | 919 |
|
918 | 920 | // MARK: - K1.ECDSAWithKeyRecovery.PublicKey + _K1PublicKeyProtocol |
919 | 921 | extension K1.ECDSAWithKeyRecovery.PublicKey: _K1PublicKeyProtocol {} |
| 922 | + |
| 923 | +// swiftlint:enable all |
0 commit comments