Fix various typos.
(Automated tooling flagged these.)
Change-Id: I1c0993efb85111bd4a4f1ea51dfe01a6cdd3edd3
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/36344
Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/ssl/test/runner/sike/consts.go b/ssl/test/runner/sike/consts.go
index 251047a..0ecff52 100644
--- a/ssl/test/runner/sike/consts.go
+++ b/ssl/test/runner/sike/consts.go
@@ -90,7 +90,7 @@
type key struct {
// Domain parameters of the algorithm to be used with a key
params *SidhParams
- // Flag indicates wether corresponds to 2-, 3-torsion group or SIKE
+ // Flag indicates whether corresponds to 2-, 3-torsion group or SIKE
keyVariant KeyVariant
}
@@ -121,7 +121,7 @@
const (
// First 2 bits identify SIDH variant third bit indicates
- // wether key is a SIKE variant (set) or SIDH (not set)
+ // whether key is a SIKE variant (set) or SIDH (not set)
// 001 - SIDH: corresponds to 2-torsion group
KeyVariant_SIDH_A KeyVariant = 1 << 0
diff --git a/ssl/test/runner/sike/sike.go b/ssl/test/runner/sike/sike.go
index 129cece..51495dc 100644
--- a/ssl/test/runner/sike/sike.go
+++ b/ssl/test/runner/sike/sike.go
@@ -38,7 +38,7 @@
// Zeroize Fp2
func zeroize(fp *Fp2) {
- // Zeroizing in 2 seperated loops tells compiler to
+ // Zeroizing in 2 separated loops tells compiler to
// use fast runtime.memclr()
for i := range fp.A {
fp.A[i] = 0
@@ -561,7 +561,7 @@
// Uses SIKE public key to encrypt plaintext. Requires cryptographically secure PRNG
// Returns ciphertext in case encryption succeeds. Returns error in case PRNG fails
-// or wrongly formated input was provided.
+// or wrongly formatted input was provided.
func Encrypt(rng io.Reader, pub *PublicKey, ptext []byte) ([]byte, error) {
var ptextLen = len(ptext)
// c1 must be security level + 64 bits (see [SIKE] 1.4 and 4.3.3)
@@ -618,7 +618,7 @@
// Encapsulation receives the public key and generates SIKE ciphertext and shared secret.
// The generated ciphertext is used for authentication.
// The rng must be cryptographically secure PRNG.
-// Error is returned in case PRNG fails or wrongly formated input was provided.
+// Error is returned in case PRNG fails or wrongly formatted input was provided.
func Encapsulate(rng io.Reader, pub *PublicKey) (ctext []byte, secret []byte, err error) {
// Buffer for random, secret message
var ptext = make([]byte, pub.params.MsgLen)
@@ -638,7 +638,7 @@
copy(hmac_key, ptext)
copy(hmac_key[len(ptext):], pub.Export())
hashMac(r, hmac_key[:len(ptext)+pub.Size()], G)
- // Ensure bitlength is not bigger then to 2^e2-1
+ // Ensure bitlength is not bigger than to 2^e2-1
r[len(r)-1] &= (1 << (pub.params.A.SecretBitLen % 8)) - 1
// (c0 || c1) = Enc(pkA, ptext; r)
@@ -663,7 +663,7 @@
// Decapsulate given the keypair and ciphertext as inputs, Decapsulate outputs a shared
// secret if plaintext verifies correctly, otherwise function outputs random value.
-// Decapsulation may fail in case input is wrongly formated.
+// Decapsulation may fail in case input is wrongly formatted.
// Constant time for properly initialized input.
func Decapsulate(prv *PrivateKey, pub *PublicKey, ctext []byte) ([]byte, error) {
var r = make([]byte, pub.params.A.SecretByteLen)
diff --git a/ssl/test/runner/sike/sike_test.go b/ssl/test/runner/sike/sike_test.go
index 76ef59e..f540c53 100644
--- a/ssl/test/runner/sike/sike_test.go
+++ b/ssl/test/runner/sike/sike_test.go
@@ -181,7 +181,7 @@
secretBytes[blen-i-1] = tmp ^ secretBytes[blen-i-1]
}
prvBig := new(big.Int).SetBytes(secretBytes)
- // Check if generated key is bigger then acceptable
+ // Check if generated key is bigger than acceptable
if prvBig.Cmp(maxSecertVal) == 1 {
t.Error("Generated private key is wrong")
}
diff --git a/util/fipstools/inject_hash/inject_hash.go b/util/fipstools/inject_hash/inject_hash.go
index 8cb9e3d..6bab143 100644
--- a/util/fipstools/inject_hash/inject_hash.go
+++ b/util/fipstools/inject_hash/inject_hash.go
@@ -121,7 +121,7 @@
}
if isStatic {
- // Static objects appear to have different symantics about whether symbol
+ // Static objects appear to have different semantics about whether symbol
// values are relative to their section or not.
base = 0
} else if symbol.Value < base {