瀏覽代碼

docs: fix typos

RekCuy63 2 月之前
父節點
當前提交
e1cc74b40b
共有 2 個文件被更改,包括 9 次插入9 次删除
  1. 7 7
      Tests/CryptoSwiftTests/ASN1Tests.swift
  2. 2 2
      Tests/CryptoSwiftTests/RSATests.swift

+ 7 - 7
Tests/CryptoSwiftTests/ASN1Tests.swift

@@ -140,8 +140,8 @@ final class ASN1Tests: XCTestCase {
   /// This tests decodes an RSA Public Key from a Base64 DER Encoded representation
   ///
   /// This test enforces that
-  /// 1) The decoding process yeilds the expected format.
-  /// 2) The re-encoding of the data yeilds the exact same starting data.
+  /// 1) The decoding process yields the expected format.
+  /// 2) The re-encoding of the data yields the exact same starting data.
   func testANS1DERDecodingPublicKey() throws {
     /// An example of an RSA Public Key ASN1 DER Encoding
     ///
@@ -211,8 +211,8 @@ final class ASN1Tests: XCTestCase {
   /// This tests decodes an RSA Private Key from a Base64 DER Encoded representation
   ///
   /// This test enforces that
-  /// 1) The decoding process yeilds the expected format.
-  /// 2) The re-encoding of the data yeilds the exact same starting data.
+  /// 1) The decoding process yields the expected format.
+  /// 2) The re-encoding of the data yields the exact same starting data.
   func testANS1DERDecodingPrivateKey() throws {
     /// An example of an RSA Private Key ASN1 DER Encoding
     ///
@@ -310,7 +310,7 @@ final class ASN1Tests: XCTestCase {
     }
     XCTAssertEqual(coefficient, Data(hex: "009c74545364466fe538e67149f41815334669ecc2245cd58120f350d20e5bc3ddd10855297a3cb93370d348b6b803e527c2e4cc42bfa3c852525586791abc48d2"))
 
-    // Ensure re-encoding the data yeilds the exact same starting data
+    // Ensure re-encoding the data yields the exact same starting data
     let asn: ASN1.Node = .sequence(nodes: [
       .integer(data: version),
       .integer(data: n),
@@ -335,8 +335,8 @@ final class ASN1Tests: XCTestCase {
   /// This tests decodes an Encrypted RSA Private Key from a Base64 PEM Encoded representation
   ///
   /// This test enforces that
-  /// 1) The decoding process yeilds the expected format.
-  /// 2) The re-encoding of the data yeilds the exact same starting data.
+  /// 1) The decoding process yields the expected format.
+  /// 2) The re-encoding of the data yields the exact same starting data.
   func testASN1DecodingEncryptedPEM() throws {
     /// ==========================
     ///  Encrypted PEM Structure

+ 2 - 2
Tests/CryptoSwiftTests/RSATests.swift

@@ -425,11 +425,11 @@ final class RSATests: XCTestCase {
                 let encrypted = try rsa.encrypt(message.key.bytes, variant: variant)
                 XCTAssertEqual(encrypted.toHexString(), Data(base64Encoded: message.value.encryptedMessage["algid:encrypt:RSA:raw"]!)!.bytes.toHexString(), "Encryption<\(test.key)>::Failed to encrypt the message `\(message.key)`")
 
-                // Decryption requires access to the Private Key, therefore attempting to decrpyt with only a public key should throw an error
+                // Decryption requires access to the Private Key, therefore attempting to decrypt with only a public key should throw an error
                 XCTAssertThrowsError(try rsa.decrypt(Data(base64Encoded: message.value.encryptedMessage["algid:encrypt:RSA:raw"]!)!.bytes), "Encryption<\(test.key)>::Did not throw error while decrypting `\(message.key)`")
               }
             } else {
-              // Sometimes the message is too long to be safely encrypted by our key. When this happens we should encouter an error and our test value should be empty.
+              // Sometimes the message is too long to be safely encrypted by our key. When this happens we should encounter an error and our test value should be empty.
               if test.value == "" {
                 XCTAssertThrowsError(try rsa.encrypt(message.key.bytes, variant: variant), "Encryption<\(test.key)>::Did not throw error while encrypting `\(message.key)`")
               } else {