Skip to content

Commit 177cc12

Browse files
arc: Fixup availability
1 parent 0b1b470 commit 177cc12

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

Sources/_CryptoExtras/ARC/ARC+API.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Crypto
1515
import Foundation
1616

1717
// MARK: - P256 + ARC(P-256)
18-
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, *)
18+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
1919
extension P256 {
2020
/// Anonymous Rate-Limited Credentials (ARC).
2121
///
@@ -32,7 +32,7 @@ extension P256 {
3232
}
3333
}
3434

35-
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, *)
35+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
3636
extension P256._ARCV1 {
3737
/// The server secrets used to issue and verify credentials.
3838
public struct PrivateKey: Sendable {
@@ -249,7 +249,7 @@ extension P256._ARCV1 {
249249
}
250250
}
251251

252-
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, *)
252+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
253253
extension P256._ARCV1.PublicKey {
254254
internal func prepareCredentialRequest<D: DataProtocol>(
255255
requestContext: D,
@@ -286,7 +286,7 @@ extension P256._ARCV1.PublicKey {
286286
}
287287
}
288288

289-
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, *)
289+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
290290
extension P256._ARCV1.PrivateKey {
291291
internal func issue(
292292
_ credentialRequest: P256._ARCV1.CredentialRequest,
@@ -302,7 +302,7 @@ extension P256._ARCV1.PrivateKey {
302302
}
303303
}
304304

305-
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, *)
305+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
306306
extension P256._ARCV1.PublicKey {
307307
/// Create a credential from the issuer response.
308308
public func finalize(
@@ -314,7 +314,7 @@ extension P256._ARCV1.PublicKey {
314314
}
315315
}
316316

317-
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, *)
317+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
318318
extension P256._ARCV1.Credential {
319319
internal mutating func makePresentation<D: DataProtocol>(
320320
context: D,

Sources/_CryptoExtras/ARC/ARCEncoding.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import Foundation
1515
import Crypto
1616

17-
@available(macOS 10.15, iOS 13, watchOS 6, tvOS 13, macCatalyst 13, visionOS 1.0, *)
17+
@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *)
1818
typealias ARCP256 = HashToCurveImpl<P256>
1919
@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *)
2020
typealias ARCP384 = HashToCurveImpl<P384>

Tests/_CryptoExtrasTests/ARC/ARCAPITests.swift

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,13 +194,15 @@ fileprivate protocol ARCCredentialResponse {
194194
var rawRepresentation: Data { get }
195195
}
196196

197+
@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *)
197198
fileprivate protocol ARCPresentation<H2G> {
198199
associatedtype H2G: HashToGroup
199200
var backing: ARC.Presentation<H2G> { get }
200201
init(rawRepresentation: some DataProtocol) throws
201202
var rawRepresentation: Data { get }
202203
}
203204

205+
@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *)
204206
fileprivate protocol ARCCredential<H2G, Presentation> {
205207
associatedtype H2G: HashToGroup
206208
associatedtype Presentation: ARCPresentation
@@ -216,6 +218,7 @@ fileprivate protocol ARCCredential<H2G, Presentation> {
216218
mutating func makePresentation(context: some DataProtocol, presentationLimit: Int) throws -> (presentation: Presentation, nonce: Int)
217219
}
218220

221+
@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *)
219222
fileprivate protocol ARCPrivateKey<H2G, CredentialRequest, CredentialResponse, Credential, Presentation> {
220223
associatedtype H2G: HashToGroup
221224
associatedtype Credential
@@ -236,6 +239,7 @@ fileprivate protocol ARCPrivateKey<H2G, CredentialRequest, CredentialResponse, C
236239
) throws -> Bool
237240
}
238241

242+
@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *)
239243
fileprivate protocol ARCPublicKey<H2G, CredentialResponse, Credential> {
240244
associatedtype H2G: HashToGroup
241245
associatedtype Precredential: ARCPrecredential
@@ -253,6 +257,7 @@ fileprivate protocol ARCPrecredential {
253257
var credentialRequest: CredentialRequest { get }
254258
}
255259

260+
@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *)
256261
fileprivate protocol ARCV1<H2G> {
257262
associatedtype H2G: HashToGroup
258263
associatedtype CredentialRequest: ARCCredentialRequest
@@ -263,41 +268,60 @@ fileprivate protocol ARCV1<H2G> {
263268
associatedtype PublicKey: ARCPublicKey<H2G, CredentialResponse, Credential>
264269
}
265270

271+
@available(macOS 10.15, iOS 13.2, tvOS 13.2, watchOS 6.1, macCatalyst 13.2, visionOS 1.2, *)
266272
fileprivate protocol ARCCurve: OpenSSLSupportedNISTCurve {
267273
associatedtype H2G: HashToGroup where H2G == OpenSSLHashToCurve<Self>
268274
associatedtype _ARCV1: ARCV1<H2G>
269275
}
270276

277+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
271278
extension P256._ARCV1.Precredential: ARCPrecredential {}
279+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
272280
extension P256._ARCV1.CredentialRequest: ARCCredentialRequest {}
281+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
273282
extension P256._ARCV1.CredentialResponse: ARCCredentialResponse {}
283+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
274284
extension P256._ARCV1.Credential: ARCCredential {}
285+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
275286
extension P256._ARCV1.Presentation: ARCPresentation {}
287+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
276288
extension P256._ARCV1.PublicKey: ARCPublicKey {
277289
typealias H2G = P256._ARCV1.H2G
278290
}
291+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
279292
extension P256._ARCV1.PrivateKey: ARCPrivateKey {}
293+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
280294
extension P256._ARCV1: ARCV1 {}
295+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
281296
extension P256: ARCCurve {}
282297

283298

284299
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
300+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
285301
extension P384._ARCV1.Precredential: ARCPrecredential {}
286302
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
303+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
287304
extension P384._ARCV1.CredentialRequest: ARCCredentialRequest {}
288305
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
306+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
289307
extension P384._ARCV1.CredentialResponse: ARCCredentialResponse {}
290308
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
309+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
291310
extension P384._ARCV1.Credential: ARCCredential {}
292311
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
312+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
293313
extension P384._ARCV1.Presentation: ARCPresentation {}
294314
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
315+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
295316
extension P384._ARCV1.PublicKey: ARCPublicKey {
296317
typealias H2G = P384._ARCV1.H2G
297318
}
298319
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
320+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
299321
extension P384._ARCV1.PrivateKey: ARCPrivateKey {}
300322
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
323+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
301324
extension P384._ARCV1: ARCV1 {}
302325
@available(*, deprecated, message: "ARC(P-384) has been removed from the IETF draft; use ARC(P-256) instead.")
326+
@available(iOS 16.0, macOS 13.0, watchOS 9.0, tvOS 16.0, macCatalyst 16.0, visionOS 2.0, *)
303327
extension P384: ARCCurve {}

0 commit comments

Comments
 (0)