Cyon fix typos (#16)

* Fixing several typos

* add math/code formatting of Weierstrass equation in docs.
This commit is contained in:
Alexander Cyon authored and GitHub committed 2020-02-04 16:00:23 +00:00
1 parent d237bf149c
commit 5000bef967
7 files changed
+10 -10

No files matched your search

+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
}
+3 -3
View File
@@ -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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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