mirror of
https://github.com/apple/swift-crypto
synced 2026-11-22 04:30:39 +00:00
Cyon fix typos (#16)
* Fixing several typos * add math/code formatting of Weierstrass equation in docs.
This commit is contained in:
1 parent
d237bf149c
commit
5000bef967
7 files changed
+10
-10
No files matched your search
@@ -120,7 +120,7 @@ extension AES.GCM {
|
||||
|
||||
@inlinable
|
||||
public init<D: DataProtocol>(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
|
||||
|
||||
|
||||
@@ -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<Plaintext: DataProtocol, AuthenticatedData: DataProtocol>
|
||||
(_ 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<AuthenticatedData: DataProtocol>
|
||||
(_ sealedBox: SealedBox, using key: Key, authenticating: AuthenticatedData) throws -> Data
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -18,7 +18,7 @@ import Foundation
|
||||
|
||||
@available(iOS 13.0, macOS 10.15, watchOS 6.0, tvOS 13.0, macCatalyst 13.0, *)
|
||||
struct HKDF<H: HashFunction> {
|
||||
/// Computes an HKDF using the parametrized Hash Function.
|
||||
/// Computes an HKDF using the parameterized Hash Function.
|
||||
///
|
||||
/// - Parameters:
|
||||
/// - inputKeyMaterial: Input key material.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user