Skip to content

Commit e9fc9af

Browse files
committed
Removed deprecations
They are causing more trouble than what it's worth. Instead, in their place, there will be warnings in the documentation.
1 parent ac5b024 commit e9fc9af

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

Sources/ATCryptography/Extensions/P256Extensions.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ extension P256.Signing.PublicKey {
4848
/// - Returns: A valid `P256.Signing.PublicKey`.
4949
/// - Throws: `P256Error.invalidCompressedKey` or `P256Error.pointNotOnCurve`
5050
/// if the data is malformed or does not represent a point on the p256 curve.
51-
@available(iOS, deprecated)
52-
@available(tvOS, deprecated)
5351
internal static func decompressP256PublicKey(compressed compressedKey: Data) throws -> P256.Signing.PublicKey {
5452
guard compressedKey.count == 33 else {
5553
throw P256Error.invalidCompressedKey
@@ -105,8 +103,6 @@ extension P256.Signing.PublicKey {
105103
///
106104
/// - Throws: `P256Error.pointNotOnCurve` if the prime does not satisfy `prime ≡ 3 mod 4`, which means
107105
/// the simplified square root algorithm cannot be used.
108-
@available(iOS, deprecated)
109-
@available(tvOS, deprecated)
110106
private static func modularSquareRoot(_ squareRoot: BigUInt, prime: BigUInt) throws -> BigUInt? {
111107
// Special case for p256 where prime ≡ 3 mod 4:
112108
// sqrt(squareRoot) ≡ squareRoot^((prime + 1) / 4) mod prime
@@ -135,8 +131,6 @@ extension Data {
135131
/// - Parameter length: The target length in bytes.
136132
/// - Returns: A new `Data` instance of exactly `length` bytes, with leading zeroes added if necessary.
137133
/// If the current length is already `>= length`, the original data is returned unchanged.
138-
@available(iOS, introduced: 13, obsoleted: 16)
139-
@available(tvOS, introduced: 13, obsoleted: 16)
140134
internal func pad(to length: Int) -> Data {
141135
if count >= length { return self }
142136
return Data(repeating: 0, count: length - count) + self
@@ -150,11 +144,6 @@ extension Data {
150144
/// point on the curve using the Weierstrass equation.
151145
///
152146
/// Use this only on iOS and tvOS 13–15. Prefer native CryptoKit APIs on newer platforms.
153-
@available(iOS, deprecated, renamed: "P256.Signing.PublicKey.init(compressedRepresentation:)", message: "Use the initializer 'P256.Signing.PublicKey(compressedRepresentation:)' available on iOS 16 and later.")
154-
@available(tvOS, deprecated, renamed: "P256.Signing.PublicKey.init(compressedRepresentation:)", message: "Use the initializer 'P256.Signing.PublicKey(compressedRepresentation:)' available on tvOS 16 and later.")
155-
@available(macOS, renamed: "P256.Signing.PublicKey.init(compressedRepresentation:)", message: "Use the initializer 'P256.Signing.PublicKey(compressedRepresentation:)' available on macOS.")
156-
@available(visionOS, renamed: "P256.Signing.PublicKey.init(compressedRepresentation:)", message: "Use the initializer 'P256.Signing.PublicKey(compressedRepresentation:)' available on visionOS.")
157-
@available(watchOS, renamed: "P256.Signing.PublicKey.init(compressedRepresentation:)", message: "Use the initializer 'P256.Signing.PublicKey(compressedRepresentation:)' available on watchOS.")
158147
internal struct CompressedP256 {
159148

160149
/// Compresses a p256 public key using SEC1 encoding.
@@ -179,11 +168,6 @@ internal struct CompressedP256 {
179168
}
180169

181170
/// Errors that may occur while working with compressed p256 keys.
182-
@available(iOS, deprecated, message: "")
183-
@available(tvOS, deprecated, message: "")
184-
@available(macOS, message: "")
185-
@available(visionOS, message: "")
186-
@available(watchOS, message: "")
187171
internal enum P256Error: Error {
188172

189173
/// The input data is not a valid compressed p256 key.

0 commit comments

Comments
 (0)