@@ -111,8 +111,8 @@ func addGarbleToHash(inputHash []byte) [sha256.Size]byte {
111111 // separate the env vars and flags, to reduce the chances of collisions.
112112 fmt .Fprintf (hasher , " GOGARBLE=%s" , sharedCache .GOGARBLE )
113113 appendFlags (hasher , true )
114- // addGarbleToHash returns the sum buffer, so we need a new copy.
115- // Otherwise the next use of the global sumBuffer would conflict .
114+ // addGarbleToHash returns the sum buffer, so we use a local copy
115+ // to avoid any potential conflicts across callers .
116116 var sumBuffer [sha256 .Size ]byte
117117 hasher .Sum (sumBuffer [:0 ])
118118 return sumBuffer
@@ -332,7 +332,7 @@ func hashWithCustomSalt(salt []byte, name string) string {
332332 // The byte after neededSumBytes is never used as part of the name,
333333 // but it is still deterministic and hard to predict,
334334 // so it provides us with useful randomness between 0 and 255.
335- // We want the number to be between 0 and hashLenthRange -1 as well,
335+ // We want the number to be between 0 and hashLengthRange -1 as well,
336336 // so we use a remainder operation.
337337 hashLengthRandomness := sum [neededSumBytes ] % ((maxHashLength - minHashLength ) + 1 )
338338 hashLength := minHashLength + hashLengthRandomness
0 commit comments