Running spelling and grammar checks over comments.

... and then run clang-format on the changed files to reflow any comment
blocks that exceeded line lengths. (Which generated a bunch of noise
formatting changes, but probably that reduces noise in future CLs.)

No semantic change to the code.

Change-Id: I455da9faaaedda3e751ac91b5eb43cbc662d68a6
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/97367
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Auto-Submit: Adam Langley <agl@google.com>
diff --git a/.clang-format b/.clang-format
index 91a1e29..2485c9b 100644
--- a/.clang-format
+++ b/.clang-format
@@ -16,7 +16,7 @@
     Priority: 5
   # Headers from our dependencies
   #
-  # TODO(davidben): A strict reading of the the style guide would suggest these
+  # TODO(davidben): A strict reading of the style guide would suggest these
   # should be grouped with C system headers. Previously we grouped them as if
   # they were "Other libraries' .h files.". Should we switch?
   - Regex: '^<(gtest|gmock|benchmark)/.*\.h>'
diff --git a/API-CONVENTIONS.md b/API-CONVENTIONS.md
index 14a08ea..7d9b8d1 100644
--- a/API-CONVENTIONS.md
+++ b/API-CONVENTIONS.md
@@ -153,7 +153,7 @@
 and returned from BoringSSL's APIs. It is an error to instantiate a heap-
 allocated type on the stack or embedded within another object.
 
-Heap-allocated types may have functioned named like `RSA_new` which allocates a
+Heap-allocated types may have functions named like `RSA_new` which allocates a
 fresh blank `RSA`. Other functions may also return newly-allocated instances.
 For example, `RSA_parse_public_key` is documented to return a newly-allocated
 `RSA` object.
diff --git a/crypto/asn1/asn1_lib.cc b/crypto/asn1/asn1_lib.cc
index 22c52d1..e41e43e 100644
--- a/crypto/asn1/asn1_lib.cc
+++ b/crypto/asn1/asn1_lib.cc
@@ -111,7 +111,7 @@
   return constructed;
 }
 
-// class 0 is constructed constructed == 2 for indefinite length constructed
+// class 0 is constructed, constructed == 2 for indefinite length constructed
 void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
                      int xclass) {
   unsigned char *p = *pp;
diff --git a/crypto/asn1/asn1_test.cc b/crypto/asn1/asn1_test.cc
index 38cd456..fd4e6cf 100644
--- a/crypto/asn1/asn1_test.cc
+++ b/crypto/asn1/asn1_test.cc
@@ -976,8 +976,7 @@
   UniquePtr<ASN1_BIT_STRING> val(ASN1_BIT_STRING_new());
   ASSERT_TRUE(val);
   const uint8_t kBytesf000[] = {0xf0, 0x00};
-  ASSERT_TRUE(
-      ASN1_STRING_set(val.get(), kBytesf000, sizeof(kBytesf000)));
+  ASSERT_TRUE(ASN1_STRING_set(val.get(), kBytesf000, sizeof(kBytesf000)));
   static const uint8_t kBitStringf000[] = {0x03, 0x03, 0x00, 0xf0, 0x00};
   TestSerialize(val.get(), i2d_ASN1_BIT_STRING, kBitStringf000);
 
@@ -1052,7 +1051,7 @@
       {{0, 0, 0, 88, 0, 0, 0xfe, 0xff},
        V_ASN1_UNIVERSALSTRING,
        "X\xef\xbb\xbf"},
-      // The maximum code-point should pass though.
+      // The maximum code-point should pass through.
       {{0, 16, 0xff, 0xfd}, V_ASN1_UNIVERSALSTRING, "\xf4\x8f\xbf\xbd"},
       // Values outside the Unicode space should not.
       {{0, 17, 0, 0}, V_ASN1_UNIVERSALSTRING, nullptr},
@@ -3087,7 +3086,7 @@
   EXPECT_EQ(obj->default_true, ASN1_BOOLEAN_TRUE);
   EXPECT_EQ(obj->default_false, ASN1_BOOLEAN_FALSE);
 
-  // Include the optinonal fields instead.
+  // Include the optional fields instead.
   static const uint8_t kFieldsIncluded[] = {0x30, 0x0c, 0x01, 0x01, 0xff,
                                             0x81, 0x01, 0x00, 0x82, 0x01,
                                             0x00, 0x83, 0x01, 0xff};
diff --git a/crypto/asn1/internal.h b/crypto/asn1/internal.h
index b471b2f..76badb2 100644
--- a/crypto/asn1/internal.h
+++ b/crypto/asn1/internal.h
@@ -192,11 +192,11 @@
 int asn1_parse_any_as_string(CBS *cbs, ASN1_STRING *out);
 
 // asn1_marshal_any marshals `in` as a DER-encoded ASN.1 value and writes the
-// result to `out`. It returns one on success and zeron on error.
+// result to `out`. It returns one on success and zero on error.
 int asn1_marshal_any(CBB *out, const ASN1_TYPE *in);
 
 // asn1_marshal_any_string marshals `in` as a DER-encoded ASN.1 value and writes
-// the result to `out`. It returns one on success and zeron on error.
+// the result to `out`. It returns one on success and zero on error.
 int asn1_marshal_any_string(CBB *out, const ASN1_STRING *in);
 
 
diff --git a/crypto/bio/bio_test.cc b/crypto/bio/bio_test.cc
index d6942c7..8c05f81 100644
--- a/crypto/bio/bio_test.cc
+++ b/crypto/bio/bio_test.cc
@@ -499,7 +499,7 @@
     bytes_read += ret;
   }
 
-  // `connect_bio` should become writeable again.
+  // `connect_bio` should become writable again.
   ASSERT_TRUE(WaitForSocket(accept_sock.get(), WaitType::kWrite))
       << LastSocketError();
   ret = BIO_write(connect_bio.get(), kTestMessage, sizeof(kTestMessage));
diff --git a/crypto/bio/internal.h b/crypto/bio/internal.h
index 18a13a3..ed00e25 100644
--- a/crypto/bio/internal.h
+++ b/crypto/bio/internal.h
@@ -28,8 +28,8 @@
 // newlib uses u_short in socket.h without defining it.
 typedef unsigned short u_short;
 #endif
-#include <sys/types.h>
 #include <sys/socket.h>
+#include <sys/types.h>
 #else
 #include <winsock2.h>
 typedef int socklen_t;
@@ -109,7 +109,7 @@
 
 // bio_socket_finish_connect attempts to complete an in-progress, non-blocking
 // connect operation on `sock`. It returns one if the connect operation
-// suceeded. Otherwise, it returns zero and sets the last socket error to the
+// succeeded. Otherwise, it returns zero and sets the last socket error to the
 // reason it failed.
 int bio_socket_finish_connect(int sock);
 
diff --git a/crypto/bytestring/cbs.cc b/crypto/bytestring/cbs.cc
index 64d2f4a..82f74af 100644
--- a/crypto/bytestring/cbs.cc
+++ b/crypto/bytestring/cbs.cc
@@ -942,7 +942,7 @@
   // If allow_timezone_offset is non-zero, allow for a four digit timezone
   // offset to be specified even though this is not allowed by RFC 5280. We are
   // permissive of this for UTCTimes due to the unfortunate existence of
-  // artisinally rolled long lived certificates that were baked into places that
+  // artisanally rolled long lived certificates that were baked into places that
   // are now difficult to change. These certificates were generated with the
   // 'openssl' command that permissively allowed the creation of certificates
   // with notBefore and notAfter times specified as strings for direct
diff --git a/crypto/cipher/asm/aes128gcmsiv-x86_64.pl b/crypto/cipher/asm/aes128gcmsiv-x86_64.pl
index a759d4e..66a4c7e 100644
--- a/crypto/cipher/asm/aes128gcmsiv-x86_64.pl
+++ b/crypto/cipher/asm/aes128gcmsiv-x86_64.pl
@@ -273,7 +273,7 @@
     jnz .Lhtable_polyval_prefix_loop
     jmp .Lhtable_polyval_prefix_complete
 
-    # hash remaining prefix bocks (up to 7 total prefix blocks)
+    # hash remaining prefix blocks (up to 7 total prefix blocks)
 .align 64
 .Lhtable_polyval_prefix_loop:
     sub \$16, $hlp0
diff --git a/crypto/cipher/e_aesgcmsiv.cc b/crypto/cipher/e_aesgcmsiv.cc
index 35f71cf..1e90af4 100644
--- a/crypto/cipher/e_aesgcmsiv.cc
+++ b/crypto/cipher/e_aesgcmsiv.cc
@@ -271,11 +271,11 @@
     return true;
   };
 
-  bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(aadvecs, f_whole,
-                                                               f_final);
+  bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
+      aadvecs, f_whole, f_final);
 
-  bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(iovecs, f_whole,
-                                                               f_final);
+  bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
+      iovecs, f_whole, f_final);
 
   uint8_t length_block[16];
   CRYPTO_store_u64_le(length_block, ad_len * 8);
@@ -847,8 +847,8 @@
     return true;
   };
 
-  bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(aadvecs, f_whole,
-                                                               f_final);
+  bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
+      aadvecs, f_whole, f_final);
 
   if (encrypt) {
     bssl::iovec::ForEachBlockRange<AES_BLOCK_SIZE, /*WriteOut=*/false>(
@@ -904,7 +904,7 @@
   }
 
   OPENSSL_memcpy(out_keys->auth_key, key_material, 16);
-  // Note the `ctr128_f` function uses a big-endian couner, while AES-GCM-SIV
+  // Note the `ctr128_f` function uses a big-endian counter, while AES-GCM-SIV
   // uses a little-endian counter. We ignore the return value and only use
   // `block128_f`. This has a significant performance cost for the fallback
   // bitsliced AES implementations (bsaes and aes_nohw).
diff --git a/crypto/compiler_test.cc b/crypto/compiler_test.cc
index 193d585..682a1e2 100644
--- a/crypto/compiler_test.cc
+++ b/crypto/compiler_test.cc
@@ -232,7 +232,7 @@
 TEST(CompilerTest, NoStrictAliasing) {
   // Sequential memory access must be sequentially consistent across types.
   // Compilers such as clang and gcc need to be passed -fno-strict-aliasing
-  // for this to remain true at at higher optimization levels. Use with the
+  // for this to remain true at higher optimization levels. Use with the
   // opposite configuration, -fstrict-aliasing, is not supported.
   // Even though some subset of type punning through memory is considered
   // undefined behavior, the subtlety of exactly which subset that is and the
diff --git a/crypto/conf/conf_test.cc b/crypto/conf/conf_test.cc
index 8b77de3..c347fd6 100644
--- a/crypto/conf/conf_test.cc
+++ b/crypto/conf/conf_test.cc
@@ -13,9 +13,9 @@
 // limitations under the License.
 
 #include <algorithm>
+#include <map>
 #include <string>
 #include <vector>
-#include <map>
 
 #include <openssl/bio.h>
 #include <openssl/conf.h>
@@ -153,7 +153,7 @@
           },
       },
 
-      // Trailing backslashes are line continations.
+      // Trailing backslashes are line continuations.
       {
           "key=\\\nvalue\nkey2=foo\\\nbar=baz",
           {
@@ -473,7 +473,7 @@
        /*remove_whitespace=*/1,
        {"ab cd", "", "ef gh"}},
   };
-  for (const auto& t : kTests) {
+  for (const auto &t : kTests) {
     SCOPED_TRACE(t.list);
     SCOPED_TRACE(t.sep);
     SCOPED_TRACE(t.remove_whitespace);
diff --git a/crypto/dh/params.cc b/crypto/dh/params.cc
index 29a0874..b981157 100644
--- a/crypto/dh/params.cc
+++ b/crypto/dh/params.cc
@@ -296,7 +296,7 @@
   //
   // I've implemented the second simple method :-).
   // Since DH should be using a safe prime (both p and q are prime),
-  // this generator function can take a very very long time to run.
+  // this generator function can take a very, very long time to run.
 
   // Actually there is no reason to insist that 'generator' be a generator.
   // It's just as OK (and in some sense better) to use a generator of the
diff --git a/crypto/evp/evp_test.cc b/crypto/evp/evp_test.cc
index 0a1c008..d19aa6f 100644
--- a/crypto/evp/evp_test.cc
+++ b/crypto/evp/evp_test.cc
@@ -849,7 +849,7 @@
       return;
     }
     EXPECT_EQ(result, 1);
-    // The correct output size was writen out.
+    // The correct output size was written out.
     EXPECT_EQ(secret_size, expected_secret_len);
     decapsulated_secret.resize(secret_size);
     EXPECT_EQ(secret, decapsulated_secret);
diff --git a/crypto/ex_data.cc b/crypto/ex_data.cc
index c3ea1f5..4614065 100644
--- a/crypto/ex_data.cc
+++ b/crypto/ex_data.cc
@@ -76,7 +76,7 @@
 int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int index, void *val) {
   if (index < 0) {
     // A caller that can accidentally pass in an invalid index into this
-    // function will hit an memory error if `index` happened to be valid, and
+    // function will hit a memory error if `index` happened to be valid, and
     // expected `val` to be of a different type.
     abort();
   }
diff --git a/crypto/fipsmodule/aes/asm/ghash-x86.pl b/crypto/fipsmodule/aes/asm/ghash-x86.pl
index 6458dfb..8fb96a8 100644
--- a/crypto/fipsmodule/aes/asm/ghash-x86.pl
+++ b/crypto/fipsmodule/aes/asm/ghash-x86.pl
@@ -104,7 +104,7 @@
 # 1.91 and 2.16. As already mentioned, this implementation processes
 # one byte out of 8KB buffer in 2.10 cycles, while x86_64 counterpart
 # - in 2.02. x86_64 performance is better, because larger register
-# bank allows to interleave reduction and multiplication better.
+# bank allows interleaving reduction and multiplication better.
 #
 # Does it make sense to increase Naggr? To start with it's virtually
 # impossible in 32-bit mode, because of limited register bank
diff --git a/crypto/fipsmodule/cipher/internal.h b/crypto/fipsmodule/cipher/internal.h
index 105ae43..a8316dd 100644
--- a/crypto/fipsmodule/cipher/internal.h
+++ b/crypto/fipsmodule/cipher/internal.h
@@ -53,7 +53,7 @@
 
   // AEADs need to provide one of the following sets of methods:
   //
-  // - openv + sealv: variable tag lenght AEAD.
+  // - openv + sealv: variable tag length AEAD.
   // - openv_detached + sealv: fixed tag length AEAD.
 
   int (*openv)(const EVP_AEAD_CTX *ctx, bssl::Span<const CRYPTO_IOVEC> iovecs,
diff --git a/crypto/fipsmodule/fips_shared_support.cc b/crypto/fipsmodule/fips_shared_support.cc
index f1f9d99..ebc64ef 100644
--- a/crypto/fipsmodule/fips_shared_support.cc
+++ b/crypto/fipsmodule/fips_shared_support.cc
@@ -16,10 +16,10 @@
 
 
 #if defined(BORINGSSL_FIPS) && defined(BORINGSSL_SHARED_LIBRARY)
-// BORINGSSL_bcm_text_hash is is default hash value for the FIPS integrity check
-// that must be replaced with the real value during the build process. This
-// value need only be distinct, i.e. so that we can safely search-and-replace it
-// in an object file.
+// BORINGSSL_bcm_text_hash is the default hash value for the FIPS integrity
+// check that must be replaced with the real value during the build process.
+// This value need only be distinct, i.e. so that we can safely
+// search-and-replace it in an object file.
 extern const uint8_t BORINGSSL_bcm_text_hash[32] = {
     0xae, 0x2c, 0xea, 0x2a, 0xbd, 0xa6, 0xf3, 0xec, 0x97, 0x7f, 0x9b,
     0xf6, 0x94, 0x9a, 0xfc, 0x83, 0x68, 0x27, 0xcb, 0xa0, 0xa0, 0x9f,
diff --git a/crypto/fipsmodule/keccak/keccak.cc.inc b/crypto/fipsmodule/keccak/keccak.cc.inc
index 264c741..eef7e65 100644
--- a/crypto/fipsmodule/keccak/keccak.cc.inc
+++ b/crypto/fipsmodule/keccak/keccak.cc.inc
@@ -113,7 +113,7 @@
     //
     // From https://keccak.team/files/Keccak-reference-3.0.pdf, section
     // 1.2, the round constants are based on the output of a LFSR. Thus, as
-    // suggested in the appendix of of
+    // suggested in the appendix of
     // https://keccak.team/keccak_specs_summary.html, the values are
     // simply encoded here.
     static const uint64_t kRoundConstants[24] = {
diff --git a/crypto/fipsmodule/sha/asm/sha1-586.pl b/crypto/fipsmodule/sha/asm/sha1-586.pl
index 0dbd3c3..9e8a5a2 100644
--- a/crypto/fipsmodule/sha/asm/sha1-586.pl
+++ b/crypto/fipsmodule/sha/asm/sha1-586.pl
@@ -47,7 +47,7 @@
 # August 2009.
 #
 # George Spelvin has tipped that F_40_59(b,c,d) can be rewritten as
-# '(c&d) + (b&(c^d))', which allows to accumulate partial results
+# '(c&d) + (b&(c^d))', which allows accumulating partial results
 # and lighten "pressure" on scratch registers. This resulted in
 # >12% performance improvement on contemporary AMD cores (with no
 # degradation on other CPUs:-). Also, the code was revised to maximize
diff --git a/crypto/fipsmodule/sha/asm/sha512-586.pl b/crypto/fipsmodule/sha/asm/sha512-586.pl
index faa9d22..59d9106 100644
--- a/crypto/fipsmodule/sha/asm/sha512-586.pl
+++ b/crypto/fipsmodule/sha/asm/sha512-586.pl
@@ -93,7 +93,7 @@
 
 $A="mm0";	# B-D and
 $E="mm4";	# F-H are commonly loaded to respectively mm1-mm3 and
-		# mm5-mm7, but it's done on on-demand basis...
+		# mm5-mm7, but it's done on an on-demand basis...
 $BxC="mm2";	# ... except for B^C
 
 sub BODY_00_15_sse2 {
diff --git a/crypto/mem_internal.h b/crypto/mem_internal.h
index 7b28cca..d58b7f3 100644
--- a/crypto/mem_internal.h
+++ b/crypto/mem_internal.h
@@ -45,9 +45,9 @@
 // allocation and not new T[n].
 //
 // When called with no arguments, it performs value-initialization, not
-// default-initialization. This means that, if selects a non-user-provided
+// default-initialization. This means that, if it selects a non-user-provided
 // constructor, the object will be zero-initialized. (As in any C++ type, once
-// `T` gains a user-provided constructors, it is responsible for initializing
+// `T` gains a user-provided constructor, it is responsible for initializing
 // all fields explicitly.)
 //
 // Note: unlike `new`, this does not support non-public constructors.
@@ -131,7 +131,7 @@
   // should call these. `DecRefInternal` returns true if the object was freed
   // and false if there are still references.
   void UpRefInternal() const {
-    // Safety: the folowing call does not mutate anything other than the atomic
+    // Safety: the following call does not mutate anything other than the atomic
     // ref-count variable.
     CRYPTO_refcount_inc(&references_);
   }
diff --git a/crypto/pkcs7/pkcs7.cc b/crypto/pkcs7/pkcs7.cc
index 6ae6a08..b1c2139 100644
--- a/crypto/pkcs7/pkcs7.cc
+++ b/crypto/pkcs7/pkcs7.cc
@@ -151,7 +151,7 @@
     }
   }
 
-  // `certificates` is a implicitly-tagged SET OF.
+  // `certificates` is an implicitly-tagged SET OF.
   return CBB_flush_asn1_set_of(&certificates) && CBB_flush(out);
 }
 
diff --git a/crypto/pkcs7/pkcs7_x509.cc b/crypto/pkcs7/pkcs7_x509.cc
index f639215..cb9a725 100644
--- a/crypto/pkcs7/pkcs7_x509.cc
+++ b/crypto/pkcs7/pkcs7_x509.cc
@@ -199,7 +199,7 @@
     }
   }
 
-  // `certificates` is a implicitly-tagged SET OF.
+  // `certificates` is an implicitly-tagged SET OF.
   return CBB_flush_asn1_set_of(&certificates) && CBB_flush(out);
 }
 
@@ -232,7 +232,7 @@
     }
   }
 
-  // `crl_data` is a implicitly-tagged SET OF.
+  // `crl_data` is an implicitly-tagged SET OF.
   return CBB_flush_asn1_set_of(&crl_data) && CBB_flush(out);
 }
 
diff --git a/crypto/pkcs8/pkcs8_x509.cc b/crypto/pkcs8/pkcs8_x509.cc
index a8625a5..2c0f3b6 100644
--- a/crypto/pkcs8/pkcs8_x509.cc
+++ b/crypto/pkcs8/pkcs8_x509.cc
@@ -1103,7 +1103,7 @@
   // recursive data format. Section 5.1 of RFC 7292 describes the encoding
   // algorithm, but there is no clear overview. A quick summary:
   //
-  // PKCS#7 defines a ContentInfo structure, which is a overgeneralized typed
+  // PKCS#7 defines a ContentInfo structure, which is an overgeneralized typed
   // combinator structure for applying cryptography. We care about two types. A
   // data ContentInfo contains an OCTET STRING and is a leaf node of the
   // combinator tree. An encrypted-data ContentInfo contains encryption
diff --git a/crypto/rand/urandom_test.cc b/crypto/rand/urandom_test.cc
index 41469af..da4864b 100644
--- a/crypto/rand/urandom_test.cc
+++ b/crypto/rand/urandom_test.cc
@@ -12,8 +12,8 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-#include <gtest/gtest.h>
 #include <stdlib.h>
+#include <gtest/gtest.h>
 
 #include <optional>
 
@@ -694,8 +694,7 @@
       if (!sysrand(kAdditionalDataLength)) {
         return ret;
       }
-      if (kUsesDaemon && !AppendDaemonEvents(&ret, flags) &&
-          !sysrand(48)) {
+      if (kUsesDaemon && !AppendDaemonEvents(&ret, flags) && !sysrand(48)) {
         return ret;
       }
     }
@@ -725,7 +724,7 @@
 }
 
 // Tests that `TestFunctionPRNGModel` is a correct model for the code in
-// urandom.c, at least to the limits of the the `Event` type.
+// urandom.c, at least to the limits of the `Event` type.
 TEST(URandomTest, Test) {
   char buf[256];
 
diff --git a/crypto/rsa/rsa_test.cc b/crypto/rsa/rsa_test.cc
index 311dbf7..0abda23 100644
--- a/crypto/rsa/rsa_test.cc
+++ b/crypto/rsa/rsa_test.cc
@@ -738,7 +738,7 @@
   ERR_clear_error();
 }
 
-// Attempting to generate an funny RSA key length should round down.
+// Attempting to generate a funny RSA key length should round down.
 TEST(RSATest, RoundKeyLengths) {
   UniquePtr<BIGNUM> e(BN_new());
   ASSERT_TRUE(e);
@@ -1392,8 +1392,9 @@
   static const uint8_t kDigest[32] = {0};
   std::vector<uint8_t> sig(RSA_size(priv.get()));
   size_t len;
-  EXPECT_FALSE(RSA_sign_pss_mgf1(priv.get(), &len, sig.data(), sig.size(), kDigest,
-                                 sizeof(kDigest), EVP_sha256(), EVP_sha256(),
+  EXPECT_FALSE(RSA_sign_pss_mgf1(priv.get(), &len, sig.data(), sig.size(),
+                                 kDigest, sizeof(kDigest), EVP_sha256(),
+                                 EVP_sha256(),
                                  /*salt_len=*/32));
 
   // But the "large e" APIs tolerate it.
diff --git a/crypto/test/abi_test.h b/crypto/test/abi_test.h
index 15ae8d2..56be916 100644
--- a/crypto/test/abi_test.h
+++ b/crypto/test/abi_test.h
@@ -153,8 +153,8 @@
 // In aarch64, r18 (accessed as w18 or x18 in a 64-bit context) is the platform
 // register. iOS says user code may not touch it. We found no clear reference
 // for Linux. The iOS behavior implies portable assembly cannot use it, and
-// aarch64 has many registers. Thus this framework ignores register's existence.
-// We test r18 violations in arm-xlate.pl.
+// aarch64 has many registers. Thus this framework ignores the register's
+// existence. We test r18 violations in arm-xlate.pl.
 #define LOOP_CALLER_STATE_REGISTERS()                                \
   /* Per AAPCS64, section 5.1.2, only the bottom 64 bits of v8-v15 */ \
   /* are preserved. These are accessed as dN. */                     \
@@ -233,7 +233,7 @@
   static_assert(sizeof(T) == 4, "parameter types must be word-sized");
   return (crypto_word_t)t;
 #elif defined(OPENSSL_X86_64) || defined(OPENSSL_AARCH64)
-  // AAPCS64, section 5.4.2, clauses C.7 and C.14 says any remaining bits in
+  // AAPCS64, section 5.4.2, clauses C.7 and C.14 say any remaining bits in
   // aarch are unspecified. iOS64 contradicts this and says the callee extends
   // arguments up to 32 bits, and only the upper 32 bits are unspecified.
   //
diff --git a/crypto/trust_token/internal.h b/crypto/trust_token/internal.h
index cb3aed5..600681b 100644
--- a/crypto/trust_token/internal.h
+++ b/crypto/trust_token/internal.h
@@ -275,7 +275,7 @@
   int (*client_key_from_bytes)(bssl::TRUST_TOKEN_CLIENT_KEY *key,
                                const uint8_t *in, size_t len);
 
-  // issuer_key_from_bytes decodes a issuer key from `in` and sets `key`
+  // issuer_key_from_bytes decodes an issuer key from `in` and sets `key`
   // to the resulting key. It returns one on success and zero
   // on failure.
   int (*issuer_key_from_bytes)(bssl::TRUST_TOKEN_ISSUER_KEY *key,
diff --git a/crypto/x509/internal.h b/crypto/x509/internal.h
index c1a9dc4..d97396c 100644
--- a/crypto/x509/internal.h
+++ b/crypto/x509/internal.h
@@ -21,8 +21,8 @@
 #include <openssl/x509.h>
 
 #include "../asn1/internal.h"
-#include "../mem_internal.h"
 #include "../internal.h"
+#include "../mem_internal.h"
 
 // Internal structures.
 
@@ -356,12 +356,12 @@
 // This is the functions plus an instance of the local variables.
 struct x509_lookup_st {
   const X509_LOOKUP_METHOD *method;  // the functions
-  void *method_data;           // method data
+  void *method_data;                 // method data
 
   X509_STORE *store_ctx;  // who owns us
 } /* X509_LOOKUP */;
 
-// This is a used when verifying cert chains.  Since the
+// This is used when verifying cert chains.  Since the
 // gathering of the cert chain can take some time (and have to be
 // 'retried', this needs to be kept and passed around.
 struct x509_store_ctx_st {
@@ -379,7 +379,7 @@
   STACK_OF(X509) *trusted_stack;
 
   // Callbacks for various operations
-  X509_STORE_CTX_verify_cb verify_cb;       // error callback
+  X509_STORE_CTX_verify_cb verify_cb;  // error callback
 
   // The following is built up
   int last_untrusted;     // index of last untrusted cert
diff --git a/crypto/x509/name_print.cc b/crypto/x509/name_print.cc
index 758a9fb..568b474 100644
--- a/crypto/x509/name_print.cc
+++ b/crypto/x509/name_print.cc
@@ -127,7 +127,7 @@
     const ASN1_OBJECT *fn = X509_NAME_ENTRY_get_object(ent);
     const ASN1_STRING *val = X509_NAME_ENTRY_get_data(ent);
     assert((flags & XN_FLAG_FN_MASK) == XN_FLAG_FN_SN);
-    // Print the short name if available, othewise serialize the OID.
+    // Print the short name if available, otherwise serialize the OID.
     char objtmp[80];
     const char *objbuf = nullptr;
     int fn_nid = OBJ_obj2nid(fn);
diff --git a/crypto/x509/v3_ncons.cc b/crypto/x509/v3_ncons.cc
index 2a7c267..2a04719 100644
--- a/crypto/x509/v3_ncons.cc
+++ b/crypto/x509/v3_ncons.cc
@@ -337,7 +337,7 @@
   }
 
   // Wildcard partial-match handling ("*.bar.com" matching name constraint
-  // "foo.bar.com"). This only handles the case where the the dnsname and the
+  // "foo.bar.com"). This only handles the case where the dnsname and the
   // constraint match after removing the leftmost label, otherwise it is handled
   // by falling through to the check of whether the dnsname is fully within or
   // fully outside of the constraint.
diff --git a/crypto/x509/x509_cmp.cc b/crypto/x509/x509_cmp.cc
index d385a0e..b544351 100644
--- a/crypto/x509/x509_cmp.cc
+++ b/crypto/x509/x509_cmp.cc
@@ -103,7 +103,7 @@
   const auto *b_impl = FromOpaque(b);
   // Fill in the `cert_hash` fields.
   //
-  // TODO(davidben): This may fail, in which case the the hash will be all
+  // TODO(davidben): This may fail, in which case the hash will be all
   // zeros. This produces a consistent comparison (failures are sticky), but
   // not a good one. OpenSSL now returns -2, but this is not a consistent
   // comparison and may cause misbehaving sorts by transitivity. For now, we
diff --git a/crypto/x509/x509_extension_test.cc b/crypto/x509/x509_extension_test.cc
index ea1299c..7ca4db4 100644
--- a/crypto/x509/x509_extension_test.cc
+++ b/crypto/x509/x509_extension_test.cc
@@ -114,7 +114,7 @@
             "1.2.840.113554.4.1.72585.2.1");
   EXPECT_EQ(policy->qualifiers, nullptr);
 
-  // The second policy has a wide range of qualfiers, to exercise the encoding.
+  // The second policy has a wide range of qualifiers, to exercise the encoding.
   policy = sk_POLICYINFO_value(policies.get(), 1);
   EXPECT_EQ(ASN1ObjectToString(policy->policyid),
             "1.2.840.113554.4.1.72585.2.2");
diff --git a/crypto/x509/x509_test.cc b/crypto/x509/x509_test.cc
index 9c2d67c..2401c45 100644
--- a/crypto/x509/x509_test.cc
+++ b/crypto/x509/x509_test.cc
@@ -2037,8 +2037,8 @@
 }
 
 static bssl::UniquePtr<X509> MakeTestCert(std::string_view issuer,
-                                          std::string_view subject, EVP_PKEY *key,
-                                          bool is_ca) {
+                                          std::string_view subject,
+                                          EVP_PKEY *key, bool is_ca) {
   UniquePtr<X509_NAME> issuer_name = MakeTestName(issuer);
   UniquePtr<X509_NAME> subject_name = MakeTestName(subject);
   UniquePtr<X509> cert(X509_new());
@@ -6421,7 +6421,7 @@
                            /*crit=*/1, X509V3_ADD_REPLACE_EXISTING));
   expect_extensions({{NID_subject_key_identifier, true, skid2_der}});
 
-  // `X509V3_ADD_REPLACE` adds a new extension if not preseent.
+  // `X509V3_ADD_REPLACE` adds a new extension if not present.
   EXPECT_EQ(
       1, X509_add1_ext_i2d(x509.get(), NID_basic_constraints, basic1_obj.get(),
                            /*crit=*/1, X509V3_ADD_REPLACE));
@@ -6433,7 +6433,7 @@
                                  X509V3_ADD_DELETE));
   expect_extensions({{NID_subject_key_identifier, true, skid2_der}});
 
-  // `X509V3_ADD_KEEP_EXISTING` adds a new extension if not preseent.
+  // `X509V3_ADD_KEEP_EXISTING` adds a new extension if not present.
   EXPECT_EQ(
       1, X509_add1_ext_i2d(x509.get(), NID_basic_constraints, basic1_obj.get(),
                            /*crit=*/1, X509V3_ADD_KEEP_EXISTING));
diff --git a/decrepit/des/cfb64ede.cc b/decrepit/des/cfb64ede.cc
index e9ad51a..8d3686c 100644
--- a/decrepit/des/cfb64ede.cc
+++ b/decrepit/des/cfb64ede.cc
@@ -25,10 +25,10 @@
 // The input and output encrypted as though 64bit cfb mode is being used. The
 // extra state information to record how much of the 64bit block we have used
 // is contained in *num;
-void DES_ede3_cfb64_encrypt(const uint8_t *in, uint8_t *out,
-                            long length, DES_key_schedule *ks1,
-                            DES_key_schedule *ks2, DES_key_schedule *ks3,
-                            DES_cblock *ivec, int *num, int enc) {
+void DES_ede3_cfb64_encrypt(const uint8_t *in, uint8_t *out, long length,
+                            DES_key_schedule *ks1, DES_key_schedule *ks2,
+                            DES_key_schedule *ks3, DES_cblock *ivec, int *num,
+                            int enc) {
   uint32_t v0, v1;
   long l = length;
   int n = *num;
@@ -86,7 +86,7 @@
   *num = n;
 }
 
-// This is compatible with the single key CFB-r for DES, even thought that's
+// This is compatible with the single key CFB-r for DES, even though that's
 // not what EVP needs.
 
 void DES_ede3_cfb_encrypt(const uint8_t *in, uint8_t *out, int numbits,
diff --git a/docs/releasing.md b/docs/releasing.md
index 5da2dfd..8b4234b 100644
--- a/docs/releasing.md
+++ b/docs/releasing.md
@@ -9,7 +9,7 @@
 
 2. Update `MODULE.bazel` with the new version and upload to Gerrit.
 
-3. Once that CL lands, make a annotated git tag at the revision. This can be
+3. Once that CL lands, make an annotated git tag at the revision. This can be
    [done from Gerrit](https://boringssl-review.googlesource.com/admin/repos/boringssl,tags).
    The "Annotation" field must be non-empty. (Just using the name of the tag
    again is fine.)
diff --git a/include/openssl/aead.h b/include/openssl/aead.h
index 82523f1..6b8ad57 100644
--- a/include/openssl/aead.h
+++ b/include/openssl/aead.h
@@ -15,7 +15,7 @@
 #ifndef OPENSSL_HEADER_AEAD_H
 #define OPENSSL_HEADER_AEAD_H
 
-#include <openssl/base.h>   // IWYU pragma: export
+#include <openssl/base.h>  // IWYU pragma: export
 
 #if defined(__cplusplus)
 extern "C" {
@@ -326,7 +326,7 @@
 //
 // At most `in_len` bytes are written to `out`. In order to ensure success,
 // `max_out_len` should be at least `in_len`. On successful return, `*out_len`
-// is set to the the actual number of bytes written.
+// is set to the actual number of bytes written.
 //
 // The length of `nonce`, `nonce_len`, must be equal to the result of
 // `EVP_AEAD_nonce_length` for this AEAD.
diff --git a/include/openssl/asm_base.h b/include/openssl/asm_base.h
index ce19034..4cea0d1 100644
--- a/include/openssl/asm_base.h
+++ b/include/openssl/asm_base.h
@@ -27,7 +27,7 @@
 // when included in assembly, adds that metadata. It also makes defines like
 // `OPENSSL_X86_64` available and includes the prefixing macros.
 //
-// Including this header in an assembly file imples:
+// Including this header in an assembly file implies:
 //
 // - The file does not require an executable stack.
 //
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h
index e599b54..d88ae82 100644
--- a/include/openssl/asn1.h
+++ b/include/openssl/asn1.h
@@ -15,7 +15,7 @@
 #ifndef OPENSSL_HEADER_ASN1_H
 #define OPENSSL_HEADER_ASN1_H
 
-#include <openssl/base.h>   // IWYU pragma: export
+#include <openssl/base.h>  // IWYU pragma: export
 
 #include <time.h>
 
@@ -916,7 +916,8 @@
 OPENSSL_EXPORT uint8_t ASN1_BIT_STRING_unused_bits(const ASN1_BIT_STRING *str);
 
 // ASN1_BIT_STRING_set calls `ASN1_STRING_set`.
-OPENSSL_EXPORT int ASN1_BIT_STRING_set(ASN1_BIT_STRING *str, const uint8_t *data,
+OPENSSL_EXPORT int ASN1_BIT_STRING_set(ASN1_BIT_STRING *str,
+                                       const uint8_t *data,
                                        ossl_ssize_t length);
 
 // ASN1_BIT_STRING_set1 sets `str` to a BIT STRING containing `length` bytes
@@ -1324,8 +1325,8 @@
 // non-standard four-digit timezone offsets on UTC times. On success, one is
 // returned. On failure, zero is returned. `ASN1_TIME_to_posix` should normally
 // be used instead of this function.
-OPENSSL_EXPORT int ASN1_TIME_to_posix_nonstandard(
-    const ASN1_TIME *t, int64_t *out);
+OPENSSL_EXPORT int ASN1_TIME_to_posix_nonstandard(const ASN1_TIME *t,
+                                                  int64_t *out);
 
 // TODO(davidben): Expand and document function prototypes generated in macros.
 
@@ -1359,7 +1360,7 @@
 
 // Object identifiers.
 //
-// An `ASN1_OBJECT` represents a ASN.1 OBJECT IDENTIFIER. See also obj.h for
+// An `ASN1_OBJECT` represents an ASN.1 OBJECT IDENTIFIER. See also obj.h for
 // additional functions relating to `ASN1_OBJECT`.
 //
 // TODO(davidben): What's the relationship between asn1.h and obj.h? Most of
diff --git a/include/openssl/bio.h b/include/openssl/bio.h
index dc4bca2..8d532d2 100644
--- a/include/openssl/bio.h
+++ b/include/openssl/bio.h
@@ -334,7 +334,7 @@
 #define BIO_NOCLOSE 0
 #define BIO_CLOSE 1
 
-// BIO_s_mem returns a `BIO_METHOD` that uses a in-memory buffer.
+// BIO_s_mem returns a `BIO_METHOD` that uses an in-memory buffer.
 OPENSSL_EXPORT const BIO_METHOD *BIO_s_mem(void);
 
 // BIO_new_mem_buf creates read-only BIO that reads from `len` bytes at `buf`.
@@ -386,7 +386,7 @@
 // File descriptor BIOs.
 //
 // File descriptor BIOs are wrappers around the system's `read` and `write`
-// functions. If the close flag is set then then `close` is called on the
+// functions. If the close flag is set then `close` is called on the
 // underlying file descriptor when the BIO is freed.
 //
 // `BIO_reset` attempts to seek the file pointer to the start of file using
diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
index 0b27aa8..324033d 100644
--- a/include/openssl/cipher.h
+++ b/include/openssl/cipher.h
@@ -15,7 +15,7 @@
 #ifndef OPENSSL_HEADER_CIPHER_H
 #define OPENSSL_HEADER_CIPHER_H
 
-#include <openssl/base.h>   // IWYU pragma: export
+#include <openssl/base.h>  // IWYU pragma: export
 
 #if defined(__cplusplus)
 extern "C" {
@@ -459,7 +459,7 @@
 
 // EVP_CIPH_FLAG_NON_FIPS_ALLOW is meaningless. In OpenSSL it permits non-FIPS
 // algorithms in FIPS mode. But BoringSSL FIPS mode doesn't prohibit algorithms
-// (it's up the the caller to use the FIPS module in a fashion compliant with
+// (it's up to the caller to use the FIPS module in a fashion compliant with
 // their needs). Thus this exists only to allow code to compile.
 #define EVP_CIPH_FLAG_NON_FIPS_ALLOW 0
 
@@ -718,7 +718,7 @@
   const EVP_CIPHER *cipher;
 
   // app_data is a pointer to opaque, user data.
-  void *app_data;      // application stuff
+  void *app_data;  // application stuff
 
   // cipher_data points to the `cipher` specific state.
   void *cipher_data;
diff --git a/include/openssl/digest.h b/include/openssl/digest.h
index a81c2a4..d9f46d6 100644
--- a/include/openssl/digest.h
+++ b/include/openssl/digest.h
@@ -314,7 +314,7 @@
 
 // EVP_MD_CTX_FLAG_NON_FIPS_ALLOW is meaningless. In OpenSSL it permits non-FIPS
 // algorithms in FIPS mode. But BoringSSL FIPS mode doesn't prohibit algorithms
-// (it's up the the caller to use the FIPS module in a fashion compliant with
+// (it's up to the caller to use the FIPS module in a fashion compliant with
 // their needs). Thus this exists only to allow code to compile.
 #define EVP_MD_CTX_FLAG_NON_FIPS_ALLOW 0
 
diff --git a/include/openssl/ec.h b/include/openssl/ec.h
index e9ed971..5dfc88a 100644
--- a/include/openssl/ec.h
+++ b/include/openssl/ec.h
@@ -27,7 +27,7 @@
 
 
 // point_conversion_form_t enumerates forms, as defined in X9.62 (ECDSA), for
-// the encoding of a elliptic curve point (x,y)
+// the encoding of an elliptic curve point (x,y)
 typedef enum {
   // POINT_CONVERSION_COMPRESSED indicates that the point is encoded as z||x,
   // where the octet z specifies which solution of the quadratic equation y
diff --git a/include/openssl/ec_key.h b/include/openssl/ec_key.h
index 2ab696c..1480520 100644
--- a/include/openssl/ec_key.h
+++ b/include/openssl/ec_key.h
@@ -16,7 +16,7 @@
 #ifndef OPENSSL_HEADER_EC_KEY_H
 #define OPENSSL_HEADER_EC_KEY_H
 
-#include <openssl/base.h>   // IWYU pragma: export
+#include <openssl/base.h>  // IWYU pragma: export
 
 #include <openssl/ec.h>
 #include <openssl/engine.h>
@@ -101,7 +101,7 @@
 // bitwise-OR of `EC_PKEY_*` values.
 OPENSSL_EXPORT void EC_KEY_set_enc_flags(EC_KEY *key, unsigned flags);
 
-// EC_KEY_get_conv_form returns the conversation form that will be used by
+// EC_KEY_get_conv_form returns the conversion form that will be used by
 // `key`.
 OPENSSL_EXPORT point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key);
 
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index 45fef4a..8f523ac 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -1136,7 +1136,7 @@
 
 // Diffie-Hellman-specific control functions.
 
-// EVP_PKEY_CTX_set_dh_pad configures configures whether `ctx`, which must be an
+// EVP_PKEY_CTX_set_dh_pad configures whether `ctx`, which must be an
 // `EVP_PKEY_derive` operation, configures the handling of leading zeros in the
 // Diffie-Hellman shared secret. If `pad` is zero, leading zeros are removed
 // from the secret. If `pad` is non-zero, the fixed-width shared secret is used
diff --git a/include/openssl/mem.h b/include/openssl/mem.h
index 2b580c0..ca265d0 100644
--- a/include/openssl/mem.h
+++ b/include/openssl/mem.h
@@ -15,10 +15,10 @@
 #ifndef OPENSSL_HEADER_MEM_H
 #define OPENSSL_HEADER_MEM_H
 
-#include <openssl/base.h>   // IWYU pragma: export
+#include <openssl/base.h>  // IWYU pragma: export
 
-#include <stdlib.h>
 #include <stdarg.h>
+#include <stdlib.h>
 
 #if defined(__cplusplus)
 extern "C" {
@@ -54,11 +54,11 @@
 // allocated and the data at `ptr` is always wiped and freed. Memory is
 // allocated with `OPENSSL_malloc` and must be freed with `OPENSSL_free`.
 OPENSSL_EXPORT void *OPENSSL_realloc(void *ptr, size_t new_size);
-#endif // !_BORINGSSL_PROHIBIT_OPENSSL_MALLOC
+#endif  // !_BORINGSSL_PROHIBIT_OPENSSL_MALLOC
 
 // OPENSSL_free does nothing if `ptr` is NULL. Otherwise it zeros out the
 // memory allocated at `ptr` and frees it along with the private data.
-// It must only be used on on `ptr` values obtained from `OPENSSL_malloc`
+// It must only be used on `ptr` values obtained from `OPENSSL_malloc`
 OPENSSL_EXPORT void OPENSSL_free(void *ptr);
 
 // OPENSSL_cleanse zeros out `len` bytes of memory at `ptr`. This is similar to
@@ -124,7 +124,7 @@
 
 // DECIMAL_SIZE returns an upper bound for the length of the decimal
 // representation of the given type.
-#define DECIMAL_SIZE(type)	((sizeof(type)*8+2)/3+1)
+#define DECIMAL_SIZE(type) ((sizeof(type) * 8 + 2) / 3 + 1)
 
 // BIO_snprintf has the same behavior as snprintf(3).
 OPENSSL_EXPORT int BIO_snprintf(char *buf, size_t n, const char *format, ...)
diff --git a/include/openssl/pki/certificate.h b/include/openssl/pki/certificate.h
index d424735..beef271 100644
--- a/include/openssl/pki/certificate.h
+++ b/include/openssl/pki/certificate.h
@@ -35,7 +35,7 @@
   ~Certificate();
   Certificate& operator=(const Certificate& other) = delete;
 
-  // FromDER returns a certificate from an DER-encoded X.509 object in `der`.
+  // FromDER returns a certificate from a DER-encoded X.509 object in `der`.
   // In the event of a failure, it will return no value, and `out_diagnostic`
   // may be set to a string of human readable debugging information if
   // information about the failure is available.
diff --git a/include/openssl/posix_time.h b/include/openssl/posix_time.h
index 7a6afc6..0a4b6a5 100644
--- a/include/openssl/posix_time.h
+++ b/include/openssl/posix_time.h
@@ -15,7 +15,7 @@
 #ifndef OPENSSL_HEADER_POSIX_TIME_H
 #define OPENSSL_HEADER_POSIX_TIME_H
 
-#include <openssl/base.h>   // IWYU pragma: export
+#include <openssl/base.h>  // IWYU pragma: export
 
 #include <time.h>
 
@@ -27,9 +27,9 @@
 // Time functions.
 
 
-// OPENSSL_posix_to_tm converts a int64_t POSIX time value in `time`, which must
-// be in the range of year 0000 to 9999, to a broken out time value in `tm`. It
-// returns one on success and zero on error.
+// OPENSSL_posix_to_tm converts an int64_t POSIX time value in `time`, which
+// must be in the range of year 0000 to 9999, to a broken out time value in
+// `tm`. It returns one on success and zero on error.
 OPENSSL_EXPORT int OPENSSL_posix_to_tm(int64_t time, struct tm *out_tm);
 
 // OPENSSL_tm_to_posix converts a time value between the years 0 and 9999 in
diff --git a/include/openssl/rsa.h b/include/openssl/rsa.h
index 45858eb..6ff32e9 100644
--- a/include/openssl/rsa.h
+++ b/include/openssl/rsa.h
@@ -368,7 +368,7 @@
 // a DigestInfo structure.
 //
 // If `padding` is `RSA_NO_PADDING`, this function only performs the raw private
-// key operation, interpreting `in` as a integer modulo n. The caller is
+// key operation, interpreting `in` as an integer modulo n. The caller is
 // responsible for hashing the input and encoding it for the signature scheme
 // being implemented.
 //
diff --git a/include/openssl/ssl.h b/include/openssl/ssl.h
index c70ba07..fca797c 100644
--- a/include/openssl/ssl.h
+++ b/include/openssl/ssl.h
@@ -2636,7 +2636,7 @@
 
 // SSL_set1_group_ids_with_flags sets the preferred groups for `ssl` to
 // `group_ids`, using the corresponding `flags` for each element, which is a set
-// of SSL_GROUP_FLAG_* values ORed toegether. Each element of `group_ids` should
+// of SSL_GROUP_FLAG_* values ORed together. Each element of `group_ids` should
 // be a unique one of the `SSL_GROUP_*` constants. If `group_ids` is empty, a
 // default list of groups and flags defaulting to zero will be set instead.
 // `group_ids` and `flags` should both have `num_group_ids` elements.  It
@@ -4294,7 +4294,7 @@
   int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level, uint8_t alert);
 };
 
-// SSL_quic_max_handshake_flight_len returns returns the maximum number of bytes
+// SSL_quic_max_handshake_flight_len returns the maximum number of bytes
 // that may be received at the given encryption level. This function should be
 // used to limit buffering in the QUIC implementation.
 //
@@ -4889,7 +4889,7 @@
 // retains its final flight for retransmission in case of loss. There is no
 // explicit protocol signal for when this completes, though after receiving
 // application data and/or a timeout it is likely that this is no longer needed.
-// BoringSSL does not currently evaluate either condition and leaves it it to
+// BoringSSL does not currently evaluate either condition and leaves it to
 // the caller to determine whether this is now unnecessary. This applies when
 // `ssl` is a server for full handshakes and when `ssl` is a client for full
 // handshakes.
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
index 6d997c1..d08e888 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -81,7 +81,7 @@
 // The caller must call `X509_free` on the result to release the reference.
 //
 // WARNING: Although the result is non-const for use with `X509_free`, it is
-// still shared with other parts of the appplication for the same object. Avoid
+// still shared with other parts of the application for the same object. Avoid
 // mutating shared `X509`s.
 OPENSSL_EXPORT X509 *X509_dup_ref(const X509 *x509);
 
@@ -107,7 +107,7 @@
 
 // X509_parse_with_algorithms parses an X.509 structure from `buf` and returns a
 // fresh X509 or NULL on error. There must not be any trailing data in `buf`.
-// The returned structure (if any) increment's `buf`'s reference count and
+// The returned structure (if any) increments `buf`'s reference count and
 // retains a reference to it.
 //
 // Only the `num_algs` algorithms from `algs` will be considered when parsing
@@ -310,7 +310,7 @@
 // X509_get0_authority_issuer returns the authorityCertIssuer of `x509`'s
 // authority key identifier, if the extension and field are present. (See
 // RFC 5280, section 4.2.1.1.) It returns NULL if the extension is not present,
-// if it is present but lacks a authorityCertIssuer field, or if some extension
+// if it is present but lacks an authorityCertIssuer field, or if some extension
 // in `x509` was invalid.
 //
 // TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for
@@ -321,7 +321,7 @@
 // X509_get0_authority_serial returns the authorityCertSerialNumber of `x509`'s
 // authority key identifier, if the extension and field are present. (See
 // RFC 5280, section 4.2.1.1.) It returns NULL if the extension is not present,
-// if it is present but lacks a authorityCertSerialNumber field, or if some
+// if it is present but lacks an authorityCertSerialNumber field, or if some
 // extension in `x509` was invalid.
 //
 // TODO(crbug.com/boringssl/381): Decoding an `X509` object will not check for
@@ -1689,7 +1689,7 @@
 // to non-critical if `crit` is zero.
 OPENSSL_EXPORT int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit);
 
-// X509_EXTENSION_set_data set's `ex`'s extension value to a copy of `data`. It
+// X509_EXTENSION_set_data sets `ex`'s extension value to a copy of `data`. It
 // returns one on success and zero on error.
 OPENSSL_EXPORT int X509_EXTENSION_set_data(X509_EXTENSION *ex,
                                            const ASN1_OCTET_STRING *data);
@@ -1888,7 +1888,7 @@
 #define X509V3_ADD_DEFAULT 0L
 
 // X509V3_ADD_APPEND causes the function to unconditionally appended the new
-// extension to to the extensions list, even if there is a duplicate.
+// extension to the extensions list, even if there is a duplicate.
 #define X509V3_ADD_APPEND 1L
 
 // X509V3_ADD_REPLACE causes the function to replace the existing extension, or
@@ -3330,7 +3330,7 @@
 // X509_VERIFY_PARAM_add0_policy adds `policy` to the user-initial-policy-set
 // (see Section 6.1.1 of RFC 5280). On success, it takes ownership of
 // `policy` and returns one. Otherwise, it returns zero and the caller retains
-// owneship of `policy`.
+// ownership of `policy`.
 OPENSSL_EXPORT int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
                                                  ASN1_OBJECT *policy);
 
@@ -5031,7 +5031,7 @@
 // decoded mask. IPv4 ranges are represented as 8-byte strings and IPv6 ranges
 // as 32-byte strings. On failure, it returns NULL.
 //
-// The text format decoded by this function is not the standard CIDR notiation.
+// The text format decoded by this function is not the standard CIDR notation.
 // Instead, the mask after the "/" is represented as another IP address. For
 // example, "192.168.0.0/16" would be written "192.168.0.0/255.255.0.0".
 OPENSSL_EXPORT ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc);
@@ -5333,7 +5333,7 @@
 
 BSSL_NAMESPACE_END
 
-}  // extern C++
+}       // extern C++
 #endif  // !BORINGSSL_NO_CXX
 
 #define X509_R_AKID_MISMATCH 100
diff --git a/pki/name_constraints.cc b/pki/name_constraints.cc
index f85ba25..be1bade 100644
--- a/pki/name_constraints.cc
+++ b/pki/name_constraints.cc
@@ -80,7 +80,7 @@
   }
 
   // Wildcard partial-match handling ("*.bar.com" matching name constraint
-  // "foo.bar.com"). This only handles the case where the the dnsname and the
+  // "foo.bar.com"). This only handles the case where the dnsname and the
   // constraint match after removing the leftmost label, otherwise it is handled
   // by falling through to the check of whether the dnsname is fully within or
   // fully outside of the constraint.
diff --git a/pki/name_constraints.h b/pki/name_constraints.h
index 06f9409..817b8c5 100644
--- a/pki/name_constraints.h
+++ b/pki/name_constraints.h
@@ -38,7 +38,7 @@
   // Parses a DER-encoded NameConstraints extension and initializes this object.
   // `extension_value` should be the extnValue from the extension (not including
   // the OCTET STRING tag). `is_critical` should be true if the extension was
-  // marked critical. Returns nullptr if parsing the the extension failed.
+  // marked critical. Returns nullptr if parsing the extension failed.
   // The object may reference data from `extension_value`, so is only valid as
   // long as `extension_value` is.
   static std::unique_ptr<NameConstraints> Create(der::Input extension_value,
diff --git a/pki/parse_certificate_unittest.cc b/pki/parse_certificate_unittest.cc
index 3c307bd..d405f0a 100644
--- a/pki/parse_certificate_unittest.cc
+++ b/pki/parse_certificate_unittest.cc
@@ -276,7 +276,7 @@
                                     CertificateVersion::V2);
 }
 
-// A version 2 certificate with both a issuer and subject unique ID field.
+// A version 2 certificate with both an issuer and subject unique ID field.
 TEST(ParseTbsCertificateTest, Version2IssuerAndSubjectUniqueId) {
   RunTbsCertificateTestGivenVersion("tbs_v2_issuer_and_subject_unique_id.pem",
                                     CertificateVersion::V2);
diff --git a/pki/path_builder.cc b/pki/path_builder.cc
index 8a36f16..1baaa9d 100644
--- a/pki/path_builder.cc
+++ b/pki/path_builder.cc
@@ -752,7 +752,8 @@
   // Diagnostic string is always "everything" about the path.
   std::string diagnostic = errors.ToDebugString(certs);
   if (!errors.ContainsHighSeverityErrors()) {
-    // TODO(bbe3): Having to check this after seems awkward: crbug.com/boringssl/713
+    // TODO(bbe3): Having to check this after seems awkward:
+    // crbug.com/boringssl/713
     if (GetTrustedCert()) {
       return VerifyError(VerifyError::StatusCode::PATH_VERIFIED, 0,
                          std::move(diagnostic));
@@ -888,7 +889,7 @@
     return GetBestValidPath()->GetVerifyError();
   }
   // We can only return one error. Returning the errors corresponding to the
-  // limits if they they appear on any path will make this error prominent even
+  // limits if they appear on any path will make this error prominent even
   // if there are other paths with different or multiple errors.
   if (exceeded_iteration_limit) {
     return VerifyError(
diff --git a/pki/path_builder_unittest.cc b/pki/path_builder_unittest.cc
index 026ce8b..c85bc9e 100644
--- a/pki/path_builder_unittest.cc
+++ b/pki/path_builder_unittest.cc
@@ -22,8 +22,8 @@
 
 #include <openssl/base.h>
 #include <openssl/bytestring.h>
-#include <openssl/pool.h>
 #include <openssl/pki/verify.h>
+#include <openssl/pool.h>
 
 #include "cert_error_params.h"
 #include "cert_issuer_source.h"
@@ -78,11 +78,9 @@
 
   void DisallowPrecert() { allow_precertificate_ = false; }
 
-  bool AcceptPreCertificates() override {
-    return allow_precertificate_;
-  }
+  bool AcceptPreCertificates() override { return allow_precertificate_; }
 
-private:
+ private:
   bool deadline_is_expired_ = false;
   bool use_signature_cache_ = false;
   bool allow_precertificate_ = false;
@@ -1010,9 +1008,7 @@
 }
 
 TEST_F(PathBuilderMultiRootTest, TestPreCertificate) {
-
-  std::string test_dir =
-      "testdata/path_builder_unittest/precertificate/";
+  std::string test_dir = "testdata/path_builder_unittest/precertificate/";
   std::shared_ptr<const ParsedCertificate> root1 =
       ReadCertFromFile(test_dir + "root.pem");
   ASSERT_TRUE(root1);
@@ -1472,7 +1468,8 @@
       ASSERT_EQ(error.Code(), VerifyError::StatusCode::PATH_VERIFIED)
           << error.DiagnosticString();
     } else {
-      ASSERT_EQ(error.Code(), VerifyError::StatusCode::PATH_ITERATION_COUNT_EXCEEDED)
+      ASSERT_EQ(error.Code(),
+                VerifyError::StatusCode::PATH_ITERATION_COUNT_EXCEEDED)
           << error.DiagnosticString();
     }
 
@@ -2136,7 +2133,7 @@
   CertPathBuilder::Result result = RunPathBuilderWithDistrustedCert(nullptr);
   {
     ASSERT_TRUE(result.HasValidPath());
-    // The built path should be identical the the one read from disk.
+    // The built path should be identical to the one read from disk.
     const auto &path = *result.GetBestValidPath();
     ASSERT_EQ(test_.chain.size(), path.certs.size());
     for (size_t i = 0; i < test_.chain.size(); ++i) {
@@ -2330,8 +2327,7 @@
     errors->AddError(mapping.internal_error, nullptr);
 
     VerifyError error = result.GetBestPathVerifyError();
-    ASSERT_EQ(error.Code(), mapping.code)
-        << error.DiagnosticString();
+    ASSERT_EQ(error.Code(), mapping.code) << error.DiagnosticString();
   }
 }
 
@@ -2635,44 +2631,42 @@
   EXPECT_FALSE(result.HasValidPath());
 
   // Cert with multiple cosigners (including valid CA cosigner) should validate
-  // succesfully, ignoring the unknown cosigners.
+  // successfully, ignoring the unknown cosigners.
   std::shared_ptr<const ParsedCertificate> standalone_leaf_3_cosigners;
-  ASSERT_TRUE(
-      ReadTestCert("mtc_plants04/mtc-leaf-standalone-3cosigners.pem",
-        &standalone_leaf_3_cosigners));
-  result = RunPathBuilder(standalone_leaf_3_cosigners,
-      &trust_store_no_subtrees, nullptr, nullptr);
+  ASSERT_TRUE(ReadTestCert("mtc_plants04/mtc-leaf-standalone-3cosigners.pem",
+                           &standalone_leaf_3_cosigners));
+  result = RunPathBuilder(standalone_leaf_3_cosigners, &trust_store_no_subtrees,
+                          nullptr, nullptr);
   EXPECT_TRUE(result.HasValidPath());
   // but it should fail if the CA key is wrong:
   result = RunPathBuilder(standalone_leaf_3_cosigners,
-      &trust_store_no_subtrees_wrong_key, nullptr, nullptr);
+                          &trust_store_no_subtrees_wrong_key, nullptr, nullptr);
   EXPECT_FALSE(result.HasValidPath());
 
   // Cert with a cosigner but no CA cosigner should fail:
   std::shared_ptr<const ParsedCertificate> standalone_leaf_no_ca_signer;
-  ASSERT_TRUE(
-      ReadTestCert("mtc_plants04/mtc-leaf-standalone-no_ca_signer.pem",
-        &standalone_leaf_no_ca_signer));
+  ASSERT_TRUE(ReadTestCert("mtc_plants04/mtc-leaf-standalone-no_ca_signer.pem",
+                           &standalone_leaf_no_ca_signer));
   result = RunPathBuilder(standalone_leaf_no_ca_signer,
-      &trust_store_no_subtrees, nullptr, nullptr);
+                          &trust_store_no_subtrees, nullptr, nullptr);
   EXPECT_FALSE(result.HasValidPath());
 
   // Cert with a duplicate CA cosigner should fail:
   std::shared_ptr<const ParsedCertificate> standalone_leaf_duplicate_ca_signer;
   ASSERT_TRUE(
       ReadTestCert("mtc_plants04/mtc-leaf-standalone-duplicate_ca_signer.pem",
-        &standalone_leaf_duplicate_ca_signer));
+                   &standalone_leaf_duplicate_ca_signer));
   result = RunPathBuilder(standalone_leaf_duplicate_ca_signer,
-      &trust_store_no_subtrees, nullptr, nullptr);
+                          &trust_store_no_subtrees, nullptr, nullptr);
   EXPECT_FALSE(result.HasValidPath());
 
   // Cert with a cosigners in non-sorted order should fail:
   std::shared_ptr<const ParsedCertificate> standalone_leaf_cosigner_wrong_order;
   ASSERT_TRUE(
       ReadTestCert("mtc_plants04/mtc-leaf-standalone-cosigner_wrong_order.pem",
-        &standalone_leaf_cosigner_wrong_order));
+                   &standalone_leaf_cosigner_wrong_order));
   result = RunPathBuilder(standalone_leaf_cosigner_wrong_order,
-      &trust_store_no_subtrees, nullptr, nullptr);
+                          &trust_store_no_subtrees, nullptr, nullptr);
   EXPECT_FALSE(result.HasValidPath());
 }
 
diff --git a/pki/signature_algorithm_unittest.cc b/pki/signature_algorithm_unittest.cc
index b2bd098..e67cfa4 100644
--- a/pki/signature_algorithm_unittest.cc
+++ b/pki/signature_algorithm_unittest.cc
@@ -328,7 +328,7 @@
   EXPECT_FALSE(ParseSignatureAlgorithm(der::Input(kData)));
 }
 
-// Parses a ecdsa-with-SHA1 which contains no parameters field.
+// Parses an ecdsa-with-SHA1 which contains no parameters field.
 //
 //   SEQUENCE (1 elem)
 //       OBJECT IDENTIFIER  1.2.840.10045.4.1
@@ -344,7 +344,7 @@
             SignatureAlgorithm::kEcdsaSha1);
 }
 
-// Parses a ecdsa-with-SHA1 which contains a NULL parameters field.
+// Parses an ecdsa-with-SHA1 which contains a NULL parameters field.
 //
 //   SEQUENCE (2 elem)
 //       OBJECT IDENTIFIER  1.2.840.10045.4.1
@@ -361,7 +361,7 @@
   EXPECT_FALSE(ParseSignatureAlgorithm(der::Input(kData)));
 }
 
-// Parses a ecdsa-with-SHA256 which contains no parameters field.
+// Parses an ecdsa-with-SHA256 which contains no parameters field.
 //
 //   SEQUENCE (1 elem)
 //       OBJECT IDENTIFIER  1.2.840.10045.4.3.2
@@ -377,7 +377,7 @@
             SignatureAlgorithm::kEcdsaSha256);
 }
 
-// Parses a ecdsa-with-SHA256 which contains a NULL parameters field.
+// Parses an ecdsa-with-SHA256 which contains a NULL parameters field.
 //
 //   SEQUENCE (2 elem)
 //       OBJECT IDENTIFIER  1.2.840.10045.4.3.2
@@ -394,7 +394,7 @@
   EXPECT_FALSE(ParseSignatureAlgorithm(der::Input(kData)));
 }
 
-// Parses a ecdsa-with-SHA384 which contains no parameters field.
+// Parses an ecdsa-with-SHA384 which contains no parameters field.
 //
 //   SEQUENCE (1 elem)
 //       OBJECT IDENTIFIER  1.2.840.10045.4.3.3
@@ -410,7 +410,7 @@
             SignatureAlgorithm::kEcdsaSha384);
 }
 
-// Parses a ecdsa-with-SHA384 which contains a NULL parameters field.
+// Parses an ecdsa-with-SHA384 which contains a NULL parameters field.
 //
 //   SEQUENCE (2 elem)
 //       OBJECT IDENTIFIER  1.2.840.10045.4.3.3
@@ -427,7 +427,7 @@
   EXPECT_FALSE(ParseSignatureAlgorithm(der::Input(kData)));
 }
 
-// Parses a ecdsa-with-SHA512 which contains no parameters field.
+// Parses an ecdsa-with-SHA512 which contains no parameters field.
 //
 //   SEQUENCE (1 elem)
 //       OBJECT IDENTIFIER  1.2.840.10045.4.3.4
@@ -443,7 +443,7 @@
             SignatureAlgorithm::kEcdsaSha512);
 }
 
-// Parses a ecdsa-with-SHA512 which contains a NULL parameters field.
+// Parses an ecdsa-with-SHA512 which contains a NULL parameters field.
 //
 //   SEQUENCE (2 elem)
 //       OBJECT IDENTIFIER  1.2.840.10045.4.3.4
diff --git a/pki/verify_certificate_chain.cc b/pki/verify_certificate_chain.cc
index f113bf7..6ff82cd 100644
--- a/pki/verify_certificate_chain.cc
+++ b/pki/verify_certificate_chain.cc
@@ -394,7 +394,7 @@
     // intermediates, there are a number of exceptions regarding CA ownership
     // and cross signing which are impossible for us to know or enforce here.
     // Therefore, we can only enforce at the level of the intermediate that
-    // issued our target certificate. This means we we differ in the following
+    // issued our target certificate. This means we differ in the following
     // ways:
     // - We only enforce at the issuer of the TLS certificate.
     // - We allow email protection to exist in the issuer, since without
@@ -2152,21 +2152,21 @@
 
   valid_policy_graph_.Init();
 
-  // RFC 5280 section section 6.1.2:
+  // RFC 5280 section 6.1.2:
   //
   // If initial-explicit-policy is set, then the initial value
   // [of explicit_policy] is 0, otherwise the initial value is n+1.
   explicit_policy_ =
       initial_explicit_policy == InitialExplicitPolicy::kTrue ? 0 : n + 1;
 
-  // RFC 5280 section section 6.1.2:
+  // RFC 5280 section 6.1.2:
   //
   // If initial-any-policy-inhibit is set, then the initial value
   // [of inhibit_anyPolicy] is 0, otherwise the initial value is n+1.
   inhibit_any_policy_ =
       initial_any_policy_inhibit == InitialAnyPolicyInhibit::kTrue ? 0 : n + 1;
 
-  // RFC 5280 section section 6.1.2:
+  // RFC 5280 section 6.1.2:
   //
   // If initial-policy-mapping-inhibit is set, then the initial value
   // [of policy_mapping] is 0, otherwise the initial value is n+1.
@@ -2175,7 +2175,7 @@
           ? 0
           : n + 1;
 
-  // RFC 5280 section section 6.1.2:
+  // RFC 5280 section 6.1.2:
   //
   // max_path_length:  this integer is initialized to n, ...
   max_path_length_ = n;
diff --git a/pki/verify_name_match_unittest.cc b/pki/verify_name_match_unittest.cc
index 8d1f462..c4da0f7 100644
--- a/pki/verify_name_match_unittest.cc
+++ b/pki/verify_name_match_unittest.cc
@@ -148,7 +148,7 @@
                                SequenceValueFromString(der)));
 }
 
-// Runs VerifyNameMatchSimpleTest for all combinations of value_type and and
+// Runs VerifyNameMatchSimpleTest for all combinations of value_type and
 // suffix.
 INSTANTIATE_TEST_SUITE_P(InstantiationName, VerifyNameMatchSimpleTest,
                          ::testing::Combine(::testing::ValuesIn(kValueTypes),
diff --git a/rust/bssl-crypto/deny.toml b/rust/bssl-crypto/deny.toml
index bfec2fe..5f9dc0a 100644
--- a/rust/bssl-crypto/deny.toml
+++ b/rust/bssl-crypto/deny.toml
@@ -1,5 +1,5 @@
 # Configuration file used for `cargo deny check`, which checks for licensing
-# issues and security adviories.
+# issues and security advisories.
 #
 # For a list of possible sections and their default values, see
 # https://github.com/EmbarkStudios/cargo-deny/blob/main/deny.template.toml
diff --git a/rust/bssl-crypto/src/ec.rs b/rust/bssl-crypto/src/ec.rs
index 5c982c0..1c3fa1e 100644
--- a/rust/bssl-crypto/src/ec.rs
+++ b/rust/bssl-crypto/src/ec.rs
@@ -210,7 +210,7 @@
     }
 
     pub fn to_x962_uncompressed(&self) -> Buffer {
-        // Safety: arguments are valid, `EC_KEY` ensures that the the group is
+        // Safety: arguments are valid, `EC_KEY` ensures that the group is
         // correct for the point, and a `Point` is always finite.
         unsafe {
             to_x962(
@@ -235,7 +235,7 @@
     /// WARNING: compressed form is rarely used and is not as well supported as
     /// the uncompressed form.
     pub fn to_x962_compressed(&self) -> Buffer {
-        // Safety: arguments are valid, `EC_KEY` ensures that the the group is
+        // Safety: arguments are valid, `EC_KEY` ensures that the group is
         // correct for the point, and a `Point` is always finite.
         unsafe {
             to_x962(
@@ -503,7 +503,7 @@
         // Safety: `self.0` is valid by construction.
         let group = unsafe { bssl_sys::EC_KEY_get0_group(self.0) };
         let point = unsafe { bssl_sys::EC_KEY_get0_public_key(self.0) };
-        // Safety: arguments are valid, `EC_KEY` ensures that the the group is
+        // Safety: arguments are valid, `EC_KEY` ensures that the group is
         // correct for the point, and a `Key` always holds a finite public point.
         unsafe {
             to_x962(
@@ -520,7 +520,7 @@
         // Safety: `self.0` is valid by construction.
         let group = unsafe { bssl_sys::EC_KEY_get0_group(self.0) };
         let point = unsafe { bssl_sys::EC_KEY_get0_public_key(self.0) };
-        // Safety: arguments are valid, `EC_KEY` ensures that the the group is
+        // Safety: arguments are valid, `EC_KEY` ensures that the group is
         // correct for the point, and a `Key` always holds a finite public point.
         unsafe {
             to_x962(
diff --git a/rust/bssl-crypto/src/ecdh.rs b/rust/bssl-crypto/src/ecdh.rs
index ea1ce93..15ace86 100644
--- a/rust/bssl-crypto/src/ecdh.rs
+++ b/rust/bssl-crypto/src/ecdh.rs
@@ -75,7 +75,7 @@
 }
 
 impl ParsedPrivateKey {
-    /// Parses an ECPrivateKey structure froma DER encoded structure per [RFC 5915],
+    /// Parses an ECPrivateKey structure from a DER encoded structure per [RFC 5915],
     /// whose curve is specified by the `ECParameters`.
     ///
     /// Unless the curve group is one of the variants of [`Group`], this method returns [`None`].
diff --git a/rust/bssl-crypto/src/ecdsa.rs b/rust/bssl-crypto/src/ecdsa.rs
index cdb61d1..568db33 100644
--- a/rust/bssl-crypto/src/ecdsa.rs
+++ b/rust/bssl-crypto/src/ecdsa.rs
@@ -170,7 +170,7 @@
 }
 
 impl ParsedPrivateKey {
-    /// Parses an ECPrivateKey structure froma DER encoded structure per [RFC 5915],
+    /// Parses an ECPrivateKey structure from a DER encoded structure per [RFC 5915],
     /// whose curve is specified by the `ECParameters`.
     ///
     /// Unless the curve group is one of the variants of [`Group`], this method returns [`None`].
diff --git a/rust/bssl-crypto/src/rsa.rs b/rust/bssl-crypto/src/rsa.rs
index 2d4407a..260c2cc 100644
--- a/rust/bssl-crypto/src/rsa.rs
+++ b/rust/bssl-crypto/src/rsa.rs
@@ -360,7 +360,7 @@
     /// Return the public key corresponding to this private key.
     pub fn as_public(&self) -> PublicKey {
         // Safety: `self.0` is valid by construction and `RSA_up_ref` means
-        // we we can pass an ownership reference to `PublicKey`.
+        // we can pass an ownership reference to `PublicKey`.
         unsafe { bssl_sys::RSA_up_ref(self.0) };
         PublicKey(self.0)
     }
diff --git a/ssl/handoff.cc b/ssl/handoff.cc
index a659ae8..5b87821 100644
--- a/ssl/handoff.cc
+++ b/ssl/handoff.cc
@@ -119,7 +119,7 @@
 
 // apply_remote_features reads a list of supported features from `in` and
 // (possibly) reconfigures `ssl` to disallow the negotiation of features whose
-// support has not been indicated.  (This prevents the the handshake from
+// support has not been indicated.  (This prevents the handshake from
 // committing to features that are not supported on the handoff/handback side.)
 static bool apply_remote_features(SSL *ssl, CBS *in) {
   CBS ciphers;
diff --git a/ssl/handshake_client.cc b/ssl/handshake_client.cc
index ff9ace8..1a37903 100644
--- a/ssl/handshake_client.cc
+++ b/ssl/handshake_client.cc
@@ -733,7 +733,7 @@
     // the session was only offered in ECH ClientHelloInner), this was the
     // TLS 1.3 compatibility mode session ID. As we know this is not a session
     // the server knows about, any server resuming it is in error. Reject the
-    // first connection deterministicly, rather than installing an invalid
+    // first connection deterministically, rather than installing an invalid
     // session into the session cache. https://crbug.com/796910
     if (ssl->session == nullptr || ssl->s3->ech_status == ssl_ech_rejected) {
       OPENSSL_PUT_ERROR(SSL, SSL_R_SERVER_ECHOED_INVALID_SESSION_ID);
diff --git a/ssl/internal.h b/ssl/internal.h
index 70ff4f7..867d5c4 100644
--- a/ssl/internal.h
+++ b/ssl/internal.h
@@ -4281,7 +4281,7 @@
   // renegotiate_mode controls how peer renegotiation attempts are handled.
   ssl_renegotiate_mode_t renegotiate_mode = ssl_renegotiate_never;
 
-  // server is true iff the this SSL* is the server half. Note: before the SSL*
+  // server is true iff this SSL* is the server half. Note: before the SSL*
   // is initialized by either SSL_set_accept_state or SSL_set_connect_state,
   // the side is not determined. In this state, server is always false.
   bool server : 1;
diff --git a/ssl/ssl_test.cc b/ssl/ssl_test.cc
index 0a7c900..7b7ce71 100644
--- a/ssl/ssl_test.cc
+++ b/ssl/ssl_test.cc
@@ -4851,7 +4851,7 @@
   EXPECT_EQ(SSL_version(server_.get()), placeholder);
 }
 
-// Tests that that `SSL_get_pending_cipher` is available during the ALPN
+// Tests that `SSL_get_pending_cipher` is available during the ALPN
 // selection callback.
 TEST_P(SSLVersionTest, ALPNCipherAvailable) {
   ASSERT_TRUE(UseCertAndKey(client_ctx_.get()));
@@ -5685,7 +5685,7 @@
   bssl::UniquePtr<SSL_CTX> ctx(SSL_CTX_new(TLS_method()));
   ASSERT_TRUE(ctx);
 
-  // Configure one cert and key pair, then replace it with noather.
+  // Configure one cert and key pair, then replace it with another.
   std::vector<CRYPTO_BUFFER *> certs = {leaf1.get(), ca1.get()};
   ASSERT_TRUE(SSL_CTX_set_chain_and_key(ctx.get(), certs.data(), certs.size(),
                                         key1.get(), nullptr));
@@ -11791,10 +11791,10 @@
   // algorithm used.
   const uint16_t kPref = SSL_SIGN_RSA_PSS_RSAE_SHA384;
   static const uint16_t kPrefs[] = {kPref};
-  ASSERT_TRUE(SSL_CTX_set_signing_algorithm_prefs(
-      server_ctx.get(), kPrefs, std::size(kPrefs)));
-  ASSERT_TRUE(SSL_CTX_set_signing_algorithm_prefs(
-      client_ctx.get(), kPrefs, std::size(kPrefs)));
+  ASSERT_TRUE(SSL_CTX_set_signing_algorithm_prefs(server_ctx.get(), kPrefs,
+                                                  std::size(kPrefs)));
+  ASSERT_TRUE(SSL_CTX_set_signing_algorithm_prefs(client_ctx.get(), kPrefs,
+                                                  std::size(kPrefs)));
 
   SSL_CTX_set_info_callback(client_ctx.get(),
                             SignatureAlgorithmUsedInfoCallback);
@@ -11817,4 +11817,3 @@
 
 }  // namespace
 BSSL_NAMESPACE_END
-
diff --git a/ssl/test/runner/common.go b/ssl/test/runner/common.go
index c241c41..c5e3d6e 100644
--- a/ssl/test/runner/common.go
+++ b/ssl/test/runner/common.go
@@ -1276,7 +1276,7 @@
 	EmptyTicketSessionID bool
 
 	// NewSessionIDLength, if non-zero is the length of the session ID to use
-	// when issung new sessions.
+	// when issuing new sessions.
 	NewSessionIDLength int
 
 	// SendClientHelloSessionID, if not nil, is the session ID sent in the
@@ -2042,7 +2042,7 @@
 	// extension to indicate a match.
 	SendNonEmptyTrustAnchorMatch bool
 
-	// AlwaysSendAvailableTrustAnchors, if true, causese the server to always
+	// AlwaysSendAvailableTrustAnchors, if true, causes the server to always
 	// send available trust anchors in EncryptedExtensions, even if unsolicited.
 	AlwaysSendAvailableTrustAnchors bool
 
diff --git a/ssl/test/runner/key_agreement.go b/ssl/test/runner/key_agreement.go
index a92df92..3b9a3b5 100644
--- a/ssl/test/runner/key_agreement.go
+++ b/ssl/test/runner/key_agreement.go
@@ -707,7 +707,7 @@
 }
 
 // ecdheKeyAgreement implements a TLS key agreement where the server
-// generates a ephemeral EC public/private key pair and signs it. The
+// generates an ephemeral EC public/private key pair and signs it. The
 // pre-master secret is then calculated using ECDH. The signature may
 // either be ECDSA or RSA.
 type ecdheKeyAgreement struct {
diff --git a/ssl/test/runner/packet_adapter.go b/ssl/test/runner/packet_adapter.go
index 96240b2..70aa545 100644
--- a/ssl/test/runner/packet_adapter.go
+++ b/ssl/test/runner/packet_adapter.go
@@ -172,7 +172,7 @@
 	return err
 }
 
-// UpdatePeerTimeout instructs the peer to set the timeoput to the specified value.
+// UpdatePeerTimeout instructs the peer to set the timeout to the specified value.
 func (p *packetAdaptor) SetPeerTimeout(d time.Duration) error {
 	p.log(fmt.Sprintf("Setting timeout to to %d ms", d.Milliseconds()), nil)
 
diff --git a/ssl/test/runner/psk_tests.go b/ssl/test/runner/psk_tests.go
index ada0a3b..b2bc901 100644
--- a/ssl/test/runner/psk_tests.go
+++ b/ssl/test/runner/psk_tests.go
@@ -803,7 +803,7 @@
 				&rsaCertificate,
 				&pskSHA256Credential,
 			},
-			// The ClientHello is not good for the certficate, so the
+			// The ClientHello is not good for the certificate, so the
 			// shim should pick the PSK.
 			flags: []string{"-expect-selected-credential", "1"},
 			expectations: connectionExpectations{
diff --git a/ssl/test/runner/runner.go b/ssl/test/runner/runner.go
index f92e3b1..69ec526 100644
--- a/ssl/test/runner/runner.go
+++ b/ssl/test/runner/runner.go
@@ -1365,7 +1365,7 @@
 }
 
 // newShimProcess starts a new shim with the specified executable, flags, and
-// environment. It internally creates a TCP listener and adds the the -port
+// environment. It internally creates a TCP listener and adds the -port
 // flag.
 func newShimProcess(dispatcher *shimDispatcher, shimPath string, flags []string, env []string) (*shimProcess, error) {
 	listener, err := dispatcher.NewShim()
diff --git a/ssl/tls13_client.cc b/ssl/tls13_client.cc
index f6272c9..36bb436 100644
--- a/ssl/tls13_client.cc
+++ b/ssl/tls13_client.cc
@@ -539,7 +539,7 @@
     ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION);
     return ssl_hs_error;
   }
-  // The above imples only one of three handshake forms will be allowed. The
+  // The above implies only one of three handshake forms will be allowed. The
   // checks for unsolicited extensions ensure the server did not select
   // something we cannot respond to.
   assert(
diff --git a/util/idextractor/clang_ast_parser.go b/util/idextractor/clang_ast_parser.go
index 3fb584b..b7afc78 100644
--- a/util/idextractor/clang_ast_parser.go
+++ b/util/idextractor/clang_ast_parser.go
@@ -275,7 +275,7 @@
 			len(n.Inner))
 	}
 
-	// Allow to ignore errors.
+	// Allow errors to be ignored.
 	defer func() {
 		if x.options.KeepGoing && err != nil {
 			log.Printf("ERROR: %v", err)
diff --git a/util/idextractor/idextractor.go b/util/idextractor/idextractor.go
index 85435cb..5241066 100644
--- a/util/idextractor/idextractor.go
+++ b/util/idextractor/idextractor.go
@@ -29,11 +29,11 @@
 	DumpFullTree bool
 	// KeepGoing does not bail out on parse errors.
 	KeepGoing bool
-	// Language is the langauge to parse the AST as.
+	// Language is the language to parse the AST as.
 	Language string
 }
 
-// New creates a new identiifer extractor.
+// New creates a new identifier extractor.
 func New(reporter func(IdentifierInfo) error, options Options) *extractor {
 	x := &extractor{
 		extractorStatic: &extractorStatic{