diff --git a/Sources/Crypto/AEADs/AES/GCM/AES-GCM.swift b/Sources/Crypto/AEADs/AES/GCM/AES-GCM.swift index d4a5262d..66a0c67c 100644 --- a/Sources/Crypto/AEADs/AES/GCM/AES-GCM.swift +++ b/Sources/Crypto/AEADs/AES/GCM/AES-GCM.swift @@ -120,7 +120,7 @@ extension AES.GCM { @inlinable public init(combined: D) throws { - // AES minumum nonce (12 bytes) + AES tag (16 bytes) + // AES minimum nonce (12 bytes) + AES tag (16 bytes) // While we have these values in the internal APIs, we can't use it in inlinable code. let aesGCMOverhead = 12 + 16 diff --git a/Sources/Crypto/AEADs/Cipher.swift b/Sources/Crypto/AEADs/Cipher.swift index 9b490df5..22fdbc78 100644 --- a/Sources/Crypto/AEADs/Cipher.swift +++ b/Sources/Crypto/AEADs/Cipher.swift @@ -48,7 +48,7 @@ protocol Cipher { /// - nonce: A Nonce used for sealing. /// - authenticatedData: Optional additional data to be authenticated. /// - Returns: The sealed box containing the ciphertext and authentication tag - /// - Throws: An error occured while encrypting or authenticating. + /// - Throws: An error occurred while encrypting or authenticating. static func seal (_ message: Plaintext, using key: SymmetricKey, nonce: Nonce?, authenticating: AuthenticatedData) throws -> SealedBox @@ -61,7 +61,7 @@ protocol Cipher { /// - nonce: The nonce used for sealing /// - authenticatedData: The data that was authenticated. /// - Returns: Returns the data, if the correct key is used and the authenticated data matches the one from the seal operation. - /// - Throws: An error occured while decrypting or authenticating. + /// - Throws: An error occurred while decrypting or authenticating. static func open (_ sealedBox: SealedBox, using key: Key, authenticating: AuthenticatedData) throws -> Data } diff --git a/Sources/Crypto/Key Agreement/ECDH.swift b/Sources/Crypto/Key Agreement/ECDH.swift index 6e1ebe0c..5b259203 100644 --- a/Sources/Crypto/Key Agreement/ECDH.swift +++ b/Sources/Crypto/Key Agreement/ECDH.swift @@ -359,7 +359,7 @@ extension P256.KeyAgreement.PrivateKey: DiffieHellmanKeyAgreement { /// /// - Parameter publicKeyShare: The public key to perform the ECDH with. /// - Returns: Returns a shared secret - /// - Throws: An error occured while computing the shared secret + /// - Throws: An error occurred while computing the shared secret public func sharedSecretFromKeyAgreement(with publicKeyShare: P256.KeyAgreement.PublicKey) throws -> SharedSecret { #if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API return try self.coreCryptoSharedSecretFromKeyAgreement(with: publicKeyShare) @@ -373,7 +373,7 @@ extension P384.KeyAgreement.PrivateKey: DiffieHellmanKeyAgreement { /// /// - Parameter publicKeyShare: The public key to perform the ECDH with. /// - Returns: Returns a shared secret - /// - Throws: An error occured while computing the shared secret + /// - Throws: An error occurred while computing the shared secret public func sharedSecretFromKeyAgreement(with publicKeyShare: P384.KeyAgreement.PublicKey) throws -> SharedSecret { #if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API return try self.coreCryptoSharedSecretFromKeyAgreement(with: publicKeyShare) @@ -387,7 +387,7 @@ extension P521.KeyAgreement.PrivateKey: DiffieHellmanKeyAgreement { /// /// - Parameter publicKeyShare: The public key to perform the ECDH with. /// - Returns: Returns a shared secret - /// - Throws: An error occured while computing the shared secret + /// - Throws: An error occurred while computing the shared secret public func sharedSecretFromKeyAgreement(with publicKeyShare: P521.KeyAgreement.PublicKey) throws -> SharedSecret { #if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API return try self.coreCryptoSharedSecretFromKeyAgreement(with: publicKeyShare) diff --git a/Sources/Crypto/Key Agreement/ECDH.swift.gyb b/Sources/Crypto/Key Agreement/ECDH.swift.gyb index 320afd2e..7d55ff96 100644 --- a/Sources/Crypto/Key Agreement/ECDH.swift.gyb +++ b/Sources/Crypto/Key Agreement/ECDH.swift.gyb @@ -97,7 +97,7 @@ extension ${CURVE}.KeyAgreement.PrivateKey: DiffieHellmanKeyAgreement { /// /// - Parameter publicKeyShare: The public key to perform the ECDH with. /// - Returns: Returns a shared secret - /// - Throws: An error occured while computing the shared secret + /// - Throws: An error occurred while computing the shared secret public func sharedSecretFromKeyAgreement(with publicKeyShare: ${CURVE}.KeyAgreement.PublicKey) throws -> SharedSecret { #if (os(macOS) || os(iOS) || os(watchOS) || os(tvOS)) && !CRYPTO_IN_SWIFTPM_FORCE_BUILD_API return try self.coreCryptoSharedSecretFromKeyAgreement(with: publicKeyShare) diff --git a/Sources/Crypto/Key Derivation/HKDF.swift b/Sources/Crypto/Key Derivation/HKDF.swift index 3d331921..5676b539 100644 --- a/Sources/Crypto/Key Derivation/HKDF.swift +++ b/Sources/Crypto/Key Derivation/HKDF.swift @@ -18,7 +18,7 @@ import Foundation @available(iOS 13.0, macOS 10.15, watchOS 6.0, tvOS 13.0, macCatalyst 13.0, *) struct HKDF { - /// Computes an HKDF using the parametrized Hash Function. + /// Computes an HKDF using the parameterized Hash Function. /// /// - Parameters: /// - inputKeyMaterial: Input key material. diff --git a/Sources/Crypto/Keys/EC/BoringSSL/EllipticCurve_boring.swift b/Sources/Crypto/Keys/EC/BoringSSL/EllipticCurve_boring.swift index edc40c18..97b764e6 100644 --- a/Sources/Crypto/Keys/EC/BoringSSL/EllipticCurve_boring.swift +++ b/Sources/Crypto/Keys/EC/BoringSSL/EllipticCurve_boring.swift @@ -63,7 +63,7 @@ extension BoringSSLEllipticCurveGroup { return try! ArbitraryPrecisionInteger(copying: baseOrder) } - /// An elliptic curve can be represented in a Weierstrass form: y² = x³ + ax + b. This + /// An elliptic curve can be represented in a Weierstrass form: `y² = x³ + ax + b`. This /// property provides the values of a and b on the curve. @usableFromInline var weierstrassCoefficients: (field: ArbitraryPrecisionInteger, a: ArbitraryPrecisionInteger, b: ArbitraryPrecisionInteger) { diff --git a/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift b/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift index f0c7aa71..49b13071 100644 --- a/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift +++ b/Sources/Crypto/Util/BoringSSL/ArbitraryPrecisionInteger_boring.swift @@ -427,7 +427,7 @@ extension ArbitraryPrecisionInteger: CustomDebugStringConvertible { // This line looks scary but it's actually pretty safe. // - // String.init(decoding:as:) treates the first argument as a Collection of UInt8, and so does not require it to be + // String.init(decoding:as:) treats the first argument as a Collection of UInt8, and so does not require it to be // null-terminated. It also doesn't take ownership of the data, instead copying the bytes in to its backing storage. // // The other note is that we don't need to free the pointer vended to us by BIO_mem_contents, as this is in fact an