From 883e3423da36ce847f60d1eaa4d82d681666ff81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9on=20Avic=20Simmons?= Date: Fri, 26 Jun 2026 17:29:38 -0400 Subject: [PATCH] Fix typos in documentation and comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - principle → principal (internal.go) - allows set → allows setting (internal.go) - creates to the verifier → creates the verifier (internal.go) - compatable → compatible (internal.go, srp_test.go) - to to → to (doc.go) - can used → can be used (doc.go) - and and → and (doc.go) - that that → that (kdf.go) - the really → they really (hash.go) - clients → client's (proof.go, example_sharedkey_test.go) --- doc.go | 6 +++--- example_sharedkey_test.go | 2 +- hash.go | 2 +- internal.go | 8 ++++---- kdf.go | 2 +- proof.go | 2 +- srp_test.go | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/doc.go b/doc.go index 05c90dc..81c88da 100644 --- a/doc.go +++ b/doc.go @@ -7,7 +7,7 @@ Package srp Secure Remote Password protocol The principal interface provided by this package is the SRP type. The end aim -of the caller is to to have an SRP server and SRP client arrive at the same +of the caller is to have an SRP server and SRP client arrive at the same key. See the documentation for the SRP structure and its methods for the nitty gritty of use. @@ -27,7 +27,7 @@ the verifier, is known as "v". The verifier is mathematically related to x and i computed by the client on first enrollment and transmitted to the server. Typically the server will store the verifier and the client will derive x from a user -secret such as a password. Because the verifier can used like a password hash with +secret such as a password. Because the verifier can be used like a password hash with respect to cracking, the derivation of x should be designed to resist password cracking if the verifier is compromised. @@ -43,7 +43,7 @@ secrets and can generate a session key, K, which may be used for further encrypt during the session. Quoting from http://srp.stanford.edu/design.html (with some modification -for KDF and and checks) +for KDF and checks) Names and notation N A large safe prime (N = 2q+1, where q is prime) diff --git a/example_sharedkey_test.go b/example_sharedkey_test.go index d9dcdae..8feb49c 100644 --- a/example_sharedkey_test.go +++ b/example_sharedkey_test.go @@ -86,7 +86,7 @@ func Example() { log.Fatal("Couldn't set up server") } - // The server will get A (clients ephemeral public key) from the client + // The server will get A (client's ephemeral public key) from the client // which the server will set using SetOthersPublic // Server MUST check error status here as defense against diff --git a/hash.go b/hash.go index c061604..3df4abd 100644 --- a/hash.go +++ b/hash.go @@ -20,7 +20,7 @@ type srpHash struct { Sha256Name string // People will need to read the source if - // the really want to use sha1. + // they really want to use sha1. sha1Name string } diff --git a/internal.go b/internal.go index 6f27732..8601216 100644 --- a/internal.go +++ b/internal.go @@ -9,7 +9,7 @@ import ( ) /* -The principle srp.go file was getting too long, so I'm putting the non-exported +The principal srp.go file was getting too long, so I'm putting the non-exported methods in here. */ @@ -35,7 +35,7 @@ func (s *SRP) generateMySecret() *big.Int { return s.ephemeralPrivate } -// setHashName allows set something other than "sha256". Please don't. +// setHashName allows setting something other than "sha256". Please don't. // TODO(jpg) Find a way that this can be called before k is computed. // //nolint:unused @@ -158,7 +158,7 @@ func (s *SRP) isUValid() bool { return true } -// makeVerifier creates to the verifier from x and parameters. +// makeVerifier creates the verifier from x and parameters. func (s *SRP) makeVerifier() (*big.Int, error) { if s.group == nil { return nil, fmt.Errorf("group not set") @@ -185,7 +185,7 @@ func (s *SRP) calculateU() (*big.Int, error) { } // calculateUNonStd creates a hash A and B -// BUG(jpg): Calculation of u does not use RFC 5054 compatable padding/hashing +// BUG(jpg): Calculation of u does not use RFC 5054 compatible padding/hashing // The scheme we use (see source) is to use SHA256 of the concatenation of A and B // each represented as a lowercase hexadecimal string. // Additionally those hex strings have leading "0" removed even if that makes them of odd length. diff --git a/kdf.go b/kdf.go index 76d8cc2..d2bdd2e 100644 --- a/kdf.go +++ b/kdf.go @@ -20,7 +20,7 @@ KDFRFC5054 is *NOT* recommended. Instead use a key derivation function (KDF) tha involves a hashing scheme designed for password hashing. The SRP verifier that is stored by the server is like a password hash with respect to crackability. Choose a KDF -that that makes the server stored verifiers hard to crack. +that makes the server stored verifiers hard to crack. This computes the client's long term secret, x from a username, password, and salt as described diff --git a/proof.go b/proof.go index 4390a18..89416ea 100644 --- a/proof.go +++ b/proof.go @@ -76,7 +76,7 @@ func (s *SRP) GoodServerProof(salt []byte, uname string, proof []byte) bool { return s.isServerProved } -// ClientProof constructs the clients proof from which it knows the key. +// ClientProof constructs the client's proof from which it knows the key. func (s *SRP) ClientProof() ([]byte, error) { if !s.isServer && !s.isServerProved { return nil, fmt.Errorf("don't construct client proof until server is proved") diff --git a/srp_test.go b/srp_test.go index 837f6a0..1423791 100644 --- a/srp_test.go +++ b/srp_test.go @@ -167,7 +167,7 @@ func TestNewSRPAgainstSpec(t *testing.T) { var ret *big.Int var retBytes []byte - // Our calculation of k is not compatable with RFC5054 + // Our calculation of k is not compatible with RFC5054 if server.k.Cmp(k) != 0 { t.Error("Didn't set k, it seems") }