[go] crypto: add common tests for the hash.Hash interface

11 views
Skip to first unread message

Manuel Sabin (Gerrit)

unread,
Jun 19, 2024, 5:35:48 PMJun 19
to goph...@pubsubhelper.golang.org, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Filippo Valsorda

Manuel Sabin added 2 comments

Patchset-level comments
File-level comment, Patchset 4 (Latest):
Manuel Sabin . resolved

Skeleton for tests for hash.Hash interface. Would love to know if this is in the right direction before I iterate on it.

File src/crypto/internal/cryptotest/hash.go
Line 38, Patchset 4 (Latest): t.Errorf(
Manuel Sabin . unresolved

Is it alright to have two different t.Errof calls in the same test like this or should they split into separate tests?

Open in Gerrit

Related details

Attention is currently required from:
  • Filippo Valsorda
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
Gerrit-Change-Number: 592855
Gerrit-PatchSet: 4
Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
Gerrit-Comment-Date: Wed, 19 Jun 2024 21:35:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
unsatisfied_requirement
open
diffy

Manuel Sabin (Gerrit)

unread,
Jun 19, 2024, 5:37:23 PMJun 19
to goph...@pubsubhelper.golang.org, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Filippo Valsorda

Manuel Sabin added 2 comments

File src/crypto/internal/cryptotest/hash.go
Line 81, Patchset 1: "digest from Sum of Write(\"%s\") != digest from consecutive calls to Write(\"%s\") and Write(\"%s\")", prefix+suffix, prefix, suffix)
Manuel Sabin . resolved

Should this include the values of the hash like on line 98?

Manuel Sabin

Done

Line 98, Patchset 1: "Sum of new hash != Sum of hash after writing %v and then calling Reset\n New hash Sum is %v\n Reset hash Sum is %v",
Manuel Sabin . resolved

Is this format ok or too verbose? The hashes are quite long, so I broke it up onto new lines.

Manuel Sabin

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Filippo Valsorda
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
Gerrit-Change-Number: 592855
Gerrit-PatchSet: 4
Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
Gerrit-Comment-Date: Wed, 19 Jun 2024 21:37:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Manuel Sabin <msab...@gmail.com>
unsatisfied_requirement
open
diffy

Manuel Sabin (Gerrit)

unread,
Jun 25, 2024, 5:34:26 PM (8 days ago) Jun 25
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Filippo Valsorda

Manuel Sabin uploaded new patchset

Manuel Sabin uploaded patch set #5 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Filippo Valsorda
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
Gerrit-Change-Number: 592855
Gerrit-PatchSet: 5
Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
Gerrit-CC: Esra Al <esra....@gmail.com>
Gerrit-CC: Garrett <garrett...@gmail.com>
Gerrit-CC: Gopher Robot <go...@golang.org>
Gerrit-CC: Russell Webb <russel...@protonmail.com>
Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
unsatisfied_requirement
open
diffy

Manuel Sabin (Gerrit)

unread,
Jun 25, 2024, 5:37:17 PM (8 days ago) Jun 25
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Filippo Valsorda

Manuel Sabin uploaded new patchset

Manuel Sabin uploaded patch set #6 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Filippo Valsorda
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
Gerrit-Change-Number: 592855
Gerrit-PatchSet: 6
unsatisfied_requirement
open
diffy

Manuel Sabin (Gerrit)

unread,
Jun 25, 2024, 5:37:49 PM (8 days ago) Jun 25
to goph...@pubsubhelper.golang.org, Clide Stefani, Esra Al, Garrett, Russell Webb, Gopher Robot, golang-co...@googlegroups.com
Attention needed from Filippo Valsorda

Manuel Sabin added 1 comment

File src/crypto/internal/cryptotest/hash.go
Line 38, Patchset 4: t.Errorf(
Manuel Sabin . resolved

Is it alright to have two different t.Errof calls in the same test like this or should they split into separate tests?

Manuel Sabin

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Filippo Valsorda
Submit Requirements:
    • requirement is not satisfiedCode-Review
    • requirement satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    • requirement is not satisfiedTryBots-Pass
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
    Gerrit-Change-Number: 592855
    Gerrit-PatchSet: 6
    Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
    Gerrit-CC: Esra Al <esra....@gmail.com>
    Gerrit-CC: Garrett <garrett...@gmail.com>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Russell Webb <russel...@protonmail.com>
    Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
    Gerrit-Comment-Date: Tue, 25 Jun 2024 21:37:45 +0000
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    Russell Webb (Gerrit)

    unread,
    Jun 26, 2024, 3:28:00 PM (7 days ago) Jun 26
    to Manuel Sabin, goph...@pubsubhelper.golang.org, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
    Attention needed from Filippo Valsorda and Manuel Sabin

    Russell Webb added 8 comments

    Patchset-level comments
    File-level comment, Patchset 6 (Latest):
    Russell Webb . resolved

    Note that when I mark a comment as "optional", I do not have strong feelings about it, and so you may reasonably mark it as "acknowledged" without making said change.

    File src/crypto/internal/cryptotest/hash.go
    Line 15, Patchset 6 (Latest): // Create one random number generator to use for all Hash tests
    rng := newRandReader(t)
    Russell Webb . unresolved

    If I understand correctly, this adds global state that will vary based on the order the tests are executed in, which is best avoided.

    https://google.github.io/styleguide/go/best-practices#global-state

    If we really need something pseudorandom, I recommend calling newRandReader in each test separately; in practice, I don't think any of these test cases really needs something pseudorandom (a repeated non-zero byte is probably sufficient).

    Line 42, Patchset 6 (Latest): "Sum appends number of bytes != Size; got %v , want %v",
    Russell Webb . unresolved

    Optional:
    "Sum appended %v bytes, expected %v bytes"

    Line 61, Patchset 6 (Latest): writeToHash(t, h, slice)
    Russell Webb . unresolved

    Optional: Add // panics if Write returns an error.

    Line 100, Patchset 6 (Latest): expectEqual(t, compositeSum, serialSum, "two successive Write calls resulted in a different Sum than a single one")
    Russell Webb . unresolved

    Optional nit: combinedSum and separateSum

    Line 131, Patchset 6 (Latest): seed := time.Now().UnixNano()
    Russell Webb . unresolved

    Broadly speaking, we don't want seeds used in tests to depend on the time the test was run at. Picking some arbitrary number would probably be fine.

    File src/crypto/md5/md5_test.go
    Line 25, Patchset 6 (Latest):func TestSHA(t *testing.T) {
    cryptotest.TestHash(t, New)
    }
    Russell Webb . unresolved

    I'm not sure if the style guide says what to do here, but for all of the implementation tests, I'd probably put the Test functions you're adding next to the other test cases (e.g. right after TestAllocations here).

    File src/crypto/sha512/sha512_test.go
    Line 27, Patchset 6 (Latest):
    func TestSHA(t *testing.T) {
    cryptotest.TestHash(t, New)
    cryptotest.TestHash(t, New512_224)
    cryptotest.TestHash(t, New512_256)
    cryptotest.TestHash(t, New384)
    }
    Russell Webb . unresolved

    When a test case fails for one of these implementations, does the failure message indicate which implementation the test was for?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Filippo Valsorda
    • Manuel Sabin
    Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
      Gerrit-Change-Number: 592855
      Gerrit-PatchSet: 6
      Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
      Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
      Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
      Gerrit-CC: Esra Al <esra....@gmail.com>
      Gerrit-CC: Garrett <garrett...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Manuel Sabin <msab...@gmail.com>
      Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
      Gerrit-Comment-Date: Wed, 26 Jun 2024 19:27:54 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      unsatisfied_requirement
      open
      diffy

      Manuel Sabin (Gerrit)

      unread,
      Jun 26, 2024, 4:32:17 PM (7 days ago) Jun 26
      to goph...@pubsubhelper.golang.org, Russell Webb, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Russell Webb

      Manuel Sabin added 11 comments

      File src/crypto/internal/cryptotest/hash.go
      Line 15, Patchset 6: // Create one random number generator to use for all Hash tests
      rng := newRandReader(t)
      Russell Webb . unresolved

      If I understand correctly, this adds global state that will vary based on the order the tests are executed in, which is best avoided.

      https://google.github.io/styleguide/go/best-practices#global-state

      If we really need something pseudorandom, I recommend calling newRandReader in each test separately; in practice, I don't think any of these test cases really needs something pseudorandom (a repeated non-zero byte is probably sufficient).

      Manuel Sabin

      I see, I was following a pattern Filippo did in https://go-review.googlesource.com/c/crypto/+/112315/3

      I don't *think* we'd want to call newRandReader in each test since it would create a new seed for the rng on each call.
      My understanding of the testing pattern for this is that newRandReader will print the seed used for all the tests and then that seed can be used to replicate the error for the whole suite of tests when debugging

      I'm not sure I understand what "will vary based on the order the tests are executed in." Do you see a debugging issue here that I'm missing?

      I also don't know that random cases help here beyond giving new test cases on each test. I was following Filippo's 112315 CL. Do you think this pattern is overkill here?

      Line 42, Patchset 6: "Sum appends number of bytes != Size; got %v , want %v",
      Russell Webb . resolved

      Optional:
      "Sum appended %v bytes, expected %v bytes"

      Manuel Sabin

      Acknowledged

      Line 61, Patchset 6: writeToHash(t, h, slice)
      Russell Webb . resolved

      Optional: Add // panics if Write returns an error.

      Manuel Sabin

      Acknowledged

      Line 64, Patchset 6:
      Manuel Sabin . resolved

      Maybe add OutOfBoundsRead test that makes sure Write(b []byte) doesn't read from more of the array that b points to than b indexes.

      Line 89, Patchset 6: writeToHash(t, h, []byte(prefix))
      Manuel Sabin . resolved

      Don't need this typecasting

      Line 100, Patchset 6: expectEqual(t, compositeSum, serialSum, "two successive Write calls resulted in a different Sum than a single one")
      Russell Webb . resolved

      Optional nit: combinedSum and separateSum

      Manuel Sabin

      Acknowledged

      Line 131, Patchset 6: seed := time.Now().UnixNano()
      Russell Webb . unresolved

      Broadly speaking, we don't want seeds used in tests to depend on the time the test was run at. Picking some arbitrary number would probably be fine.

      Manuel Sabin

      Replied to in previous comment, but this function was lifted directly from CL 112315 and my understanding of the pattern is that it yields new test cases on each run while also printing the seed to hardcode when debugging. Do you think I should change this pattern for the rest of the tests going forward?

      File src/crypto/md5/md5_test.go
      Line 25, Patchset 6:func TestSHA(t *testing.T) {
      cryptotest.TestHash(t, New)
      }
      Russell Webb . unresolved

      I'm not sure if the style guide says what to do here, but for all of the implementation tests, I'd probably put the Test functions you're adding next to the other test cases (e.g. right after TestAllocations here).

      Manuel Sabin

      Sounds good. So the convention would be to call the interface tester *after* all of the implementation-specific tests going forward, yes? (I currently put them at the beginning before any implementation-specific tests begin)

      File src/crypto/sha256/sha256_test.go
      Line 22, Patchset 5: cryptotest.TestHash(t, New)
      cryptotest.TestHash(t, New224)
      Manuel Sabin . resolved

      Include these in t.Run calls that name the key size

      File src/crypto/sha512/sha512_test.go
      Line 29, Patchset 5: cryptotest.TestHash(t, New)

      cryptotest.TestHash(t, New512_224)
      cryptotest.TestHash(t, New512_256)
      cryptotest.TestHash(t, New384)
      Manuel Sabin . resolved

      Include these in t.Run calls that name the key size for each test


      func TestSHA(t *testing.T) {
      cryptotest.TestHash(t, New)
      cryptotest.TestHash(t, New512_224)
      cryptotest.TestHash(t, New512_256)
      cryptotest.TestHash(t, New384)
      }
      Russell Webb . resolved

      When a test case fails for one of these implementations, does the failure message indicate which implementation the test was for?

      Manuel Sabin

      Done

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Clide Stefani
      • Esra Al
      • Filippo Valsorda
      • Garrett
      • Russell Webb
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
      Gerrit-Change-Number: 592855
      Gerrit-PatchSet: 7
      Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
      Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
      Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
      Gerrit-CC: Esra Al <esra....@gmail.com>
      Gerrit-CC: Garrett <garrett...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Esra Al <esra....@gmail.com>
      Gerrit-Attention: Garrett <garrett...@gmail.com>
      Gerrit-Attention: Russell Webb <russel...@protonmail.com>
      Gerrit-Attention: Clide Stefani <cstefan...@gmail.com>
      Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
      Gerrit-Comment-Date: Wed, 26 Jun 2024 20:32:12 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Russell Webb <russel...@protonmail.com>
      unsatisfied_requirement
      open
      diffy

      Manuel Sabin (Gerrit)

      unread,
      Jun 26, 2024, 4:32:18 PM (7 days ago) Jun 26
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Russell Webb

      Manuel Sabin uploaded new patchset

      Manuel Sabin uploaded patch set #7 to this change.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Clide Stefani
      • Esra Al
      • Filippo Valsorda
      • Garrett
      • Russell Webb
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      unsatisfied_requirement
      open
      diffy

      Russell Webb (Gerrit)

      unread,
      Jun 26, 2024, 5:07:45 PM (7 days ago) Jun 26
      to Manuel Sabin, goph...@pubsubhelper.golang.org, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Manuel Sabin

      Russell Webb added 3 comments

      File src/crypto/internal/cryptotest/hash.go
      Line 15, Patchset 6: // Create one random number generator to use for all Hash tests
      rng := newRandReader(t)
      Russell Webb . unresolved

      If I understand correctly, this adds global state that will vary based on the order the tests are executed in, which is best avoided.

      https://google.github.io/styleguide/go/best-practices#global-state

      If we really need something pseudorandom, I recommend calling newRandReader in each test separately; in practice, I don't think any of these test cases really needs something pseudorandom (a repeated non-zero byte is probably sufficient).

      Manuel Sabin

      I see, I was following a pattern Filippo did in https://go-review.googlesource.com/c/crypto/+/112315/3

      I don't *think* we'd want to call newRandReader in each test since it would create a new seed for the rng on each call.
      My understanding of the testing pattern for this is that newRandReader will print the seed used for all the tests and then that seed can be used to replicate the error for the whole suite of tests when debugging

      I'm not sure I understand what "will vary based on the order the tests are executed in." Do you see a debugging issue here that I'm missing?

      I also don't know that random cases help here beyond giving new test cases on each test. I was following Filippo's 112315 CL. Do you think this pattern is overkill here?

      Russell Webb

      Re: "the order the tests are executed in": my understanding is that if the pseudorandom number generator is seeded once then shared between tests, the random numbers that each test gets will be affected by how many previous numbers had been retrieved from the pRNG - which is in turn affected by how many of the other tests had run before the current one.

      Conversely, if each test gets its own pRNG, the calls Test 1 makes to pRNG A should not affect the result of the calls Test 2 makes to pRNG B.

      It's possible that I'm incorrect, and that the pRNG is not *really* shared state between tests.

      ---

      I do think adding (pseudo-)entropy for these tests is overkill, but I'm not passionate on the subject; I'll defer to Filippo/Roland about that.

      Line 131, Patchset 6: seed := time.Now().UnixNano()
      Russell Webb . resolved

      Broadly speaking, we don't want seeds used in tests to depend on the time the test was run at. Picking some arbitrary number would probably be fine.

      Manuel Sabin

      Replied to in previous comment, but this function was lifted directly from CL 112315 and my understanding of the pattern is that it yields new test cases on each run while also printing the seed to hardcode when debugging. Do you think I should change this pattern for the rest of the tests going forward?

      Russell Webb

      (see above)

      File src/crypto/md5/md5_test.go
      Line 25, Patchset 6:func TestSHA(t *testing.T) {
      cryptotest.TestHash(t, New)
      }
      Russell Webb . unresolved

      I'm not sure if the style guide says what to do here, but for all of the implementation tests, I'd probably put the Test functions you're adding next to the other test cases (e.g. right after TestAllocations here).

      Manuel Sabin

      Sounds good. So the convention would be to call the interface tester *after* all of the implementation-specific tests going forward, yes? (I currently put them at the beginning before any implementation-specific tests begin)

      Russell Webb

      I'm not too worried about whether it's before/after the implementation-specific tests; I just have a mild preference that it be next to the other Test functions rather than between the md5Test struct definition and the golden data definitions (it can get lost in there).

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Clide Stefani
      • Esra Al
      • Filippo Valsorda
      • Garrett
      • Manuel Sabin
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
      Gerrit-Change-Number: 592855
      Gerrit-PatchSet: 7
      Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
      Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
      Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
      Gerrit-CC: Esra Al <esra....@gmail.com>
      Gerrit-CC: Garrett <garrett...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Esra Al <esra....@gmail.com>
      Gerrit-Attention: Garrett <garrett...@gmail.com>
      Gerrit-Attention: Manuel Sabin <msab...@gmail.com>
      Gerrit-Attention: Clide Stefani <cstefan...@gmail.com>
      Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
      Gerrit-Comment-Date: Wed, 26 Jun 2024 21:07:40 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Russell Webb <russel...@protonmail.com>
      Comment-In-Reply-To: Manuel Sabin <msab...@gmail.com>
      unsatisfied_requirement
      open
      diffy

      Manuel Sabin (Gerrit)

      unread,
      Jun 26, 2024, 6:01:45 PM (7 days ago) Jun 26
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Russell Webb

      Manuel Sabin uploaded new patchset

      Manuel Sabin uploaded patch set #8 to this change.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Clide Stefani
      • Esra Al
      • Filippo Valsorda
      • Garrett
      • Russell Webb
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: newpatchset
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
      Gerrit-Change-Number: 592855
      Gerrit-PatchSet: 8
      Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
      Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
      Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
      Gerrit-CC: Esra Al <esra....@gmail.com>
      Gerrit-CC: Garrett <garrett...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Esra Al <esra....@gmail.com>
      Gerrit-Attention: Garrett <garrett...@gmail.com>
      Gerrit-Attention: Russell Webb <russel...@protonmail.com>
      unsatisfied_requirement
      open
      diffy

      Manuel Sabin (Gerrit)

      unread,
      Jun 26, 2024, 6:01:47 PM (7 days ago) Jun 26
      to goph...@pubsubhelper.golang.org, Russell Webb, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Russell Webb

      Manuel Sabin added 3 comments

      File src/crypto/internal/cryptotest/hash.go
      Line 15, Patchset 6: // Create one random number generator to use for all Hash tests
      rng := newRandReader(t)
      Russell Webb . unresolved

      If I understand correctly, this adds global state that will vary based on the order the tests are executed in, which is best avoided.

      https://google.github.io/styleguide/go/best-practices#global-state

      If we really need something pseudorandom, I recommend calling newRandReader in each test separately; in practice, I don't think any of these test cases really needs something pseudorandom (a repeated non-zero byte is probably sufficient).

      Manuel Sabin

      I see, I was following a pattern Filippo did in https://go-review.googlesource.com/c/crypto/+/112315/3

      I don't *think* we'd want to call newRandReader in each test since it would create a new seed for the rng on each call.
      My understanding of the testing pattern for this is that newRandReader will print the seed used for all the tests and then that seed can be used to replicate the error for the whole suite of tests when debugging

      I'm not sure I understand what "will vary based on the order the tests are executed in." Do you see a debugging issue here that I'm missing?

      I also don't know that random cases help here beyond giving new test cases on each test. I was following Filippo's 112315 CL. Do you think this pattern is overkill here?

      Russell Webb

      Re: "the order the tests are executed in": my understanding is that if the pseudorandom number generator is seeded once then shared between tests, the random numbers that each test gets will be affected by how many previous numbers had been retrieved from the pRNG - which is in turn affected by how many of the other tests had run before the current one.

      Conversely, if each test gets its own pRNG, the calls Test 1 makes to pRNG A should not affect the result of the calls Test 2 makes to pRNG B.

      It's possible that I'm incorrect, and that the pRNG is not *really* shared state between tests.

      ---

      I do think adding (pseudo-)entropy for these tests is overkill, but I'm not passionate on the subject; I'll defer to Filippo/Roland about that.

      Manuel Sabin

      I see, yes, that's my understanding too: PRG for a given seed conceptually yields a static tape of fixed psuedorandom bytes and each call to it increments the pointer on that tape by the number of bytes read from it. So it is stateful in that way and state is shared in that other tests making calls to it will leave the next test at a different starting point on that tape.

      Knowing the seed will let you deterministically reproduce the test for all sub-tests but, to your point, if a change is made to one test's calls to the PRG while debugging then that will affect the pseudorandom bytes the next test gets.

      The testing readout may get more cluttered with PRG seeds by putting it in each subtest instead of once at the top of the containing test, but that may be worth it for ease of debugging.
      I'll defer to Filippo/Roland as well on this

      File src/crypto/md5/md5_test.go
      Line 25, Patchset 6:func TestSHA(t *testing.T) {
      cryptotest.TestHash(t, New)
      }
      Russell Webb . unresolved

      I'm not sure if the style guide says what to do here, but for all of the implementation tests, I'd probably put the Test functions you're adding next to the other test cases (e.g. right after TestAllocations here).

      Manuel Sabin

      Sounds good. So the convention would be to call the interface tester *after* all of the implementation-specific tests going forward, yes? (I currently put them at the beginning before any implementation-specific tests begin)

      Russell Webb

      I'm not too worried about whether it's before/after the implementation-specific tests; I just have a mild preference that it be next to the other Test functions rather than between the md5Test struct definition and the golden data definitions (it can get lost in there).

      Manuel Sabin

      Sounds good! That placement was an accident, I meant to put it at the very top of the file (right under the imports). I'll place all my interface tester calls right under "import" of each implementation test if that sounds good to you.

      File src/crypto/sha512/sha512_test.go

      func TestSHA(t *testing.T) {
      cryptotest.TestHash(t, New)
      cryptotest.TestHash(t, New512_224)
      cryptotest.TestHash(t, New512_256)
      cryptotest.TestHash(t, New384)
      }
      Russell Webb . resolved

      When a test case fails for one of these implementations, does the failure message indicate which implementation the test was for?

      Manuel Sabin

      Done

      Manuel Sabin

      Added labeled subtests for each one

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Clide Stefani
      • Esra Al
      • Filippo Valsorda
      • Garrett
      • Russell Webb
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
      Gerrit-Change-Number: 592855
      Gerrit-PatchSet: 8
      Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
      Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
      Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
      Gerrit-CC: Esra Al <esra....@gmail.com>
      Gerrit-CC: Garrett <garrett...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Esra Al <esra....@gmail.com>
      Gerrit-Attention: Garrett <garrett...@gmail.com>
      Gerrit-Attention: Russell Webb <russel...@protonmail.com>
      Gerrit-Attention: Clide Stefani <cstefan...@gmail.com>
      Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
      Gerrit-Comment-Date: Wed, 26 Jun 2024 22:01:40 +0000
      unsatisfied_requirement
      open
      diffy

      Russell Webb (Gerrit)

      unread,
      Jun 27, 2024, 10:55:43 AM (6 days ago) Jun 27
      to Manuel Sabin, goph...@pubsubhelper.golang.org, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
      Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Manuel Sabin

      Russell Webb added 1 comment

      File src/crypto/md5/md5_test.go
      Line 25, Patchset 6:func TestSHA(t *testing.T) {
      cryptotest.TestHash(t, New)
      }
      Russell Webb . unresolved

      I'm not sure if the style guide says what to do here, but for all of the implementation tests, I'd probably put the Test functions you're adding next to the other test cases (e.g. right after TestAllocations here).

      Manuel Sabin

      Sounds good. So the convention would be to call the interface tester *after* all of the implementation-specific tests going forward, yes? (I currently put them at the beginning before any implementation-specific tests begin)

      Russell Webb

      I'm not too worried about whether it's before/after the implementation-specific tests; I just have a mild preference that it be next to the other Test functions rather than between the md5Test struct definition and the golden data definitions (it can get lost in there).

      Manuel Sabin

      Sounds good! That placement was an accident, I meant to put it at the very top of the file (right under the imports). I'll place all my interface tester calls right under "import" of each implementation test if that sounds good to you.

      Russell Webb

      If I understand correctly, you're talking about moving it up to line 18 or so? If so, that'd still separate TestSHA from the rest of the tests, which strikes me as undesirable for the reasons I laid out above.

      That said, I'll leave that to Filippo.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Clide Stefani
      • Esra Al
      • Filippo Valsorda
      • Garrett
      • Manuel Sabin
      Submit Requirements:
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      • requirement is not satisfiedTryBots-Pass
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: go
      Gerrit-Branch: master
      Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
      Gerrit-Change-Number: 592855
      Gerrit-PatchSet: 8
      Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
      Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
      Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
      Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
      Gerrit-CC: Esra Al <esra....@gmail.com>
      Gerrit-CC: Garrett <garrett...@gmail.com>
      Gerrit-CC: Gopher Robot <go...@golang.org>
      Gerrit-Attention: Esra Al <esra....@gmail.com>
      Gerrit-Attention: Garrett <garrett...@gmail.com>
      Gerrit-Attention: Manuel Sabin <msab...@gmail.com>
      Gerrit-Attention: Clide Stefani <cstefan...@gmail.com>
      Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
      Gerrit-Comment-Date: Thu, 27 Jun 2024 14:55:37 +0000
      unsatisfied_requirement
      open
      diffy

      Manuel Sabin (Gerrit)

      unread,
      Jun 28, 2024, 10:18:26 AM (5 days ago) Jun 28
      to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
      Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Russell Webb

      Manuel Sabin uploaded new patchset

      Manuel Sabin uploaded patch set #9 to this change.
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Clide Stefani
      • Esra Al
      • Filippo Valsorda
      • Garrett
      • Russell Webb
      Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
        Gerrit-Change-Number: 592855
        Gerrit-PatchSet: 9
        Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
        Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
        Gerrit-CC: Esra Al <esra....@gmail.com>
        Gerrit-CC: Garrett <garrett...@gmail.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-Attention: Esra Al <esra....@gmail.com>
        Gerrit-Attention: Garrett <garrett...@gmail.com>
        Gerrit-Attention: Russell Webb <russel...@protonmail.com>
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Manuel Sabin (Gerrit)

        unread,
        Jun 28, 2024, 10:18:27 AM (5 days ago) Jun 28
        to goph...@pubsubhelper.golang.org, Russell Webb, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Russell Webb

        Manuel Sabin added 2 comments

        File src/crypto/internal/cryptotest/hash.go
        Line 15, Patchset 6: // Create one random number generator to use for all Hash tests
        rng := newRandReader(t)
        Russell Webb . resolved

        If I understand correctly, this adds global state that will vary based on the order the tests are executed in, which is best avoided.

        https://google.github.io/styleguide/go/best-practices#global-state

        If we really need something pseudorandom, I recommend calling newRandReader in each test separately; in practice, I don't think any of these test cases really needs something pseudorandom (a repeated non-zero byte is probably sufficient).

        Manuel Sabin

        I see, I was following a pattern Filippo did in https://go-review.googlesource.com/c/crypto/+/112315/3

        I don't *think* we'd want to call newRandReader in each test since it would create a new seed for the rng on each call.
        My understanding of the testing pattern for this is that newRandReader will print the seed used for all the tests and then that seed can be used to replicate the error for the whole suite of tests when debugging

        I'm not sure I understand what "will vary based on the order the tests are executed in." Do you see a debugging issue here that I'm missing?

        I also don't know that random cases help here beyond giving new test cases on each test. I was following Filippo's 112315 CL. Do you think this pattern is overkill here?

        Russell Webb

        Re: "the order the tests are executed in": my understanding is that if the pseudorandom number generator is seeded once then shared between tests, the random numbers that each test gets will be affected by how many previous numbers had been retrieved from the pRNG - which is in turn affected by how many of the other tests had run before the current one.

        Conversely, if each test gets its own pRNG, the calls Test 1 makes to pRNG A should not affect the result of the calls Test 2 makes to pRNG B.

        It's possible that I'm incorrect, and that the pRNG is not *really* shared state between tests.

        ---

        I do think adding (pseudo-)entropy for these tests is overkill, but I'm not passionate on the subject; I'll defer to Filippo/Roland about that.

        Manuel Sabin

        I see, yes, that's my understanding too: PRG for a given seed conceptually yields a static tape of fixed psuedorandom bytes and each call to it increments the pointer on that tape by the number of bytes read from it. So it is stateful in that way and state is shared in that other tests making calls to it will leave the next test at a different starting point on that tape.

        Knowing the seed will let you deterministically reproduce the test for all sub-tests but, to your point, if a change is made to one test's calls to the PRG while debugging then that will affect the pseudorandom bytes the next test gets.

        The testing readout may get more cluttered with PRG seeds by putting it in each subtest instead of once at the top of the containing test, but that may be worth it for ease of debugging.
        I'll defer to Filippo/Roland as well on this

        Manuel Sabin

        Done

        File src/crypto/md5/md5_test.go
        Line 25, Patchset 6:func TestSHA(t *testing.T) {
        cryptotest.TestHash(t, New)
        }
        Russell Webb . resolved

        I'm not sure if the style guide says what to do here, but for all of the implementation tests, I'd probably put the Test functions you're adding next to the other test cases (e.g. right after TestAllocations here).

        Manuel Sabin

        Sounds good. So the convention would be to call the interface tester *after* all of the implementation-specific tests going forward, yes? (I currently put them at the beginning before any implementation-specific tests begin)

        Russell Webb

        I'm not too worried about whether it's before/after the implementation-specific tests; I just have a mild preference that it be next to the other Test functions rather than between the md5Test struct definition and the golden data definitions (it can get lost in there).

        Manuel Sabin

        Sounds good! That placement was an accident, I meant to put it at the very top of the file (right under the imports). I'll place all my interface tester calls right under "import" of each implementation test if that sounds good to you.

        Russell Webb

        If I understand correctly, you're talking about moving it up to line 18 or so? If so, that'd still separate TestSHA from the rest of the tests, which strikes me as undesirable for the reasons I laid out above.

        That said, I'll leave that to Filippo.

        Manuel Sabin

        Done

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Clide Stefani
        • Esra Al
        • Filippo Valsorda
        • Garrett
        • Russell Webb
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
        Gerrit-Change-Number: 592855
        Gerrit-PatchSet: 9
        Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
        Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
        Gerrit-CC: Esra Al <esra....@gmail.com>
        Gerrit-CC: Garrett <garrett...@gmail.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-Attention: Esra Al <esra....@gmail.com>
        Gerrit-Attention: Garrett <garrett...@gmail.com>
        Gerrit-Attention: Russell Webb <russel...@protonmail.com>
        Gerrit-Attention: Clide Stefani <cstefan...@gmail.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Fri, 28 Jun 2024 14:18:21 +0000
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Russell Webb (Gerrit)

        unread,
        Jun 28, 2024, 12:44:02 PM (5 days ago) Jun 28
        to Manuel Sabin, goph...@pubsubhelper.golang.org, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Manuel Sabin

        Russell Webb voted Code-Review+1

        Code-Review+1
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Clide Stefani
        • Esra Al
        • Filippo Valsorda
        • Garrett
        • Manuel Sabin
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: comment
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
        Gerrit-Change-Number: 592855
        Gerrit-PatchSet: 9
        Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
        Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
        Gerrit-CC: Esra Al <esra....@gmail.com>
        Gerrit-CC: Garrett <garrett...@gmail.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-Attention: Esra Al <esra....@gmail.com>
        Gerrit-Attention: Garrett <garrett...@gmail.com>
        Gerrit-Attention: Manuel Sabin <msab...@gmail.com>
        Gerrit-Attention: Clide Stefani <cstefan...@gmail.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Fri, 28 Jun 2024 16:43:57 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        qiu laidongfeng2 (Gerrit)

        unread,
        Jun 30, 2024, 9:52:43 AM (3 days ago) Jun 30
        to Manuel Sabin, goph...@pubsubhelper.golang.org, Russell Webb, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett and Manuel Sabin

        qiu laidongfeng2 voted Commit-Queue+1

        Commit-Queue+1
        Gerrit-Reviewer: qiu laidongfeng2 <26454...@qq.com>
        Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
        Gerrit-CC: Esra Al <esra....@gmail.com>
        Gerrit-CC: Garrett <garrett...@gmail.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-Attention: Esra Al <esra....@gmail.com>
        Gerrit-Attention: Garrett <garrett...@gmail.com>
        Gerrit-Attention: Manuel Sabin <msab...@gmail.com>
        Gerrit-Attention: Clide Stefani <cstefan...@gmail.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        Gerrit-Comment-Date: Sun, 30 Jun 2024 13:52:36 +0000
        Gerrit-HasComments: No
        Gerrit-Has-Labels: Yes
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Manuel Sabin (Gerrit)

        unread,
        Jul 1, 2024, 3:59:49 PM (2 days ago) Jul 1
        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Clide Stefani, Esra Al, Filippo Valsorda, Garrett, Manuel Sabin and qiu laidongfeng2

        Manuel Sabin uploaded new patchset

        Manuel Sabin uploaded patch set #10 to this change.
        Following approvals got outdated and were removed:
        • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Clide Stefani
        • Esra Al
        • Filippo Valsorda
        • Garrett
        • Manuel Sabin
        • qiu laidongfeng2
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
        Gerrit-Change-Number: 592855
        Gerrit-PatchSet: 10
        Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
        Gerrit-Reviewer: qiu laidongfeng2 <26454...@qq.com>
        Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
        Gerrit-CC: Esra Al <esra....@gmail.com>
        Gerrit-CC: Garrett <garrett...@gmail.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-Attention: Esra Al <esra....@gmail.com>
        Gerrit-Attention: Garrett <garrett...@gmail.com>
        Gerrit-Attention: Manuel Sabin <msab...@gmail.com>
        Gerrit-Attention: Clide Stefani <cstefan...@gmail.com>
        Gerrit-Attention: qiu laidongfeng2 <26454...@qq.com>
        Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Manuel Sabin (Gerrit)

        unread,
        12:07 PM (9 hours ago) 12:07 PM
        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Filippo Valsorda, Manuel Sabin and qiu laidongfeng2

        Manuel Sabin uploaded new patchset

        Manuel Sabin uploaded patch set #11 to this change.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Filippo Valsorda
        • Manuel Sabin
        • qiu laidongfeng2
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
        Gerrit-Change-Number: 592855
        Gerrit-PatchSet: 11
        Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
        Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
        Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
        Gerrit-Reviewer: qiu laidongfeng2 <26454...@qq.com>
        Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
        Gerrit-CC: Esra Al <esra....@gmail.com>
        Gerrit-CC: Garrett <garrett...@gmail.com>
        Gerrit-CC: Gopher Robot <go...@golang.org>
        Gerrit-Attention: Manuel Sabin <msab...@gmail.com>
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Manuel Sabin (Gerrit)

        unread,
        12:13 PM (9 hours ago) 12:13 PM
        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Filippo Valsorda, Manuel Sabin and qiu laidongfeng2

        Manuel Sabin uploaded new patchset

        Manuel Sabin uploaded patch set #12 to this change.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Filippo Valsorda
        • Manuel Sabin
        • qiu laidongfeng2
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
        Gerrit-Change-Number: 592855
        Gerrit-PatchSet: 12
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Manuel Sabin (Gerrit)

        unread,
        2:08 PM (7 hours ago) 2:08 PM
        to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
        Attention needed from Filippo Valsorda, Manuel Sabin and qiu laidongfeng2

        Manuel Sabin uploaded new patchset

        Manuel Sabin uploaded patch set #13 to this change.
        Open in Gerrit

        Related details

        Attention is currently required from:
        • Filippo Valsorda
        • Manuel Sabin
        • qiu laidongfeng2
        Submit Requirements:
        • requirement is not satisfiedCode-Review
        • requirement satisfiedNo-Unresolved-Comments
        • requirement is not satisfiedReview-Enforcement
        • requirement is not satisfiedTryBots-Pass
        Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
        Gerrit-MessageType: newpatchset
        Gerrit-Project: go
        Gerrit-Branch: master
        Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
        Gerrit-Change-Number: 592855
        Gerrit-PatchSet: 13
        unsatisfied_requirement
        satisfied_requirement
        open
        diffy

        Filippo Valsorda (Gerrit)

        unread,
        2:54 PM (6 hours ago) 2:54 PM
        to Manuel Sabin, goph...@pubsubhelper.golang.org, Roland Shoemaker, Go LUCI, qiu laidongfeng2, Russell Webb, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
        Attention needed from Manuel Sabin, Roland Shoemaker and qiu laidongfeng2

        Filippo Valsorda voted and added 8 comments

        Votes added by Filippo Valsorda

        Code-Review+1
        Commit-Queue+1

        8 comments

        Patchset-level comments
        File-level comment, Patchset 13 (Latest):
        Filippo Valsorda . resolved

        Roland PTAL at the next PS.

        Commit Message
        Line 7, Patchset 13 (Latest):crypto: add common tests for the hash.Hash interface
        Filippo Valsorda . unresolved

        crypto/internal/cryptotest:

        Line 12, Patchset 13 (Latest):tests to most of the crypto/ hash implementation test suites. It
        currently skips the hmac implementation since the keyed hash requires
        more setup.
        Filippo Valsorda . unresolved

        old

        File src/crypto/internal/cryptotest/hash.go
        Line 96, Patchset 13 (Latest): ctrlDigest := getSum(t, h, nil) //Record control digest
        Filippo Valsorda . unresolved

        Space after //

        Line 152, Patchset 13 (Latest): t.Errorf(
        "Write returned error; got (%v, %v), want (nil, %v)",
        err, n, len(p))
        Filippo Valsorda . unresolved

        nit: can be one line.

        Line 186, Patchset 13 (Latest):func expectEqual(t *testing.T, got, want []byte, msg string) {
        Filippo Valsorda . unresolved

        nit: inline this

        File src/go/build/deps_test.go
        Line 645, Patchset 11: bytes, hash, io, math/rand, testing, time
        Filippo Valsorda . unresolved

        CRYPTO-MATH, testing

        Line 716, Patchset 11 (Parent):
        Filippo Valsorda . unresolved

        spurious

        Open in Gerrit

        Related details

        Attention is currently required from:
        • Manuel Sabin
        • Roland Shoemaker
        • qiu laidongfeng2
        Submit Requirements:
          • requirement is not satisfiedCode-Review
          • requirement is not satisfiedNo-Unresolved-Comments
          • requirement is not satisfiedReview-Enforcement
          • requirement is not satisfiedTryBots-Pass
          Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
          Gerrit-MessageType: comment
          Gerrit-Project: go
          Gerrit-Branch: master
          Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
          Gerrit-Change-Number: 592855
          Gerrit-PatchSet: 13
          Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
          Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
          Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
          Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
          Gerrit-Reviewer: qiu laidongfeng2 <26454...@qq.com>
          Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
          Gerrit-CC: Esra Al <esra....@gmail.com>
          Gerrit-CC: Garrett <garrett...@gmail.com>
          Gerrit-CC: Gopher Robot <go...@golang.org>
          Gerrit-Attention: Manuel Sabin <msab...@gmail.com>
          Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
          Gerrit-Attention: qiu laidongfeng2 <26454...@qq.com>
          Gerrit-Comment-Date: Wed, 03 Jul 2024 18:54:17 +0000
          Gerrit-HasComments: Yes
          Gerrit-Has-Labels: Yes
          unsatisfied_requirement
          open
          diffy

          Manuel Sabin (Gerrit)

          unread,
          4:45 PM (5 hours ago) 4:45 PM
          to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
          Attention needed from Manuel Sabin, Roland Shoemaker and qiu laidongfeng2

          Manuel Sabin uploaded new patchset

          Manuel Sabin uploaded patch set #14 to this change.
          Open in Gerrit

          Related details

          Attention is currently required from:
          • Manuel Sabin
          • Roland Shoemaker
          • qiu laidongfeng2
          Submit Requirements:
            • requirement is not satisfiedCode-Review
            • requirement is not satisfiedNo-Unresolved-Comments
            • requirement is not satisfiedReview-Enforcement
            • requirement satisfiedTryBots-Pass
            Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
            Gerrit-MessageType: newpatchset
            Gerrit-Project: go
            Gerrit-Branch: master
            Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
            Gerrit-Change-Number: 592855
            Gerrit-PatchSet: 14
            unsatisfied_requirement
            satisfied_requirement
            open
            diffy

            Manuel Sabin (Gerrit)

            unread,
            4:48 PM (5 hours ago) 4:48 PM
            to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
            Attention needed from Filippo Valsorda, Roland Shoemaker and qiu laidongfeng2

            Manuel Sabin uploaded new patchset

            Manuel Sabin uploaded patch set #15 to this change.
            Following approvals got outdated and were removed:
            • TryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
            Open in Gerrit

            Related details

            Attention is currently required from:
            • Filippo Valsorda
            • Roland Shoemaker
            • qiu laidongfeng2
            Submit Requirements:
              • requirement is not satisfiedCode-Review
              • requirement satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              • requirement is not satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: newpatchset
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
              Gerrit-Change-Number: 592855
              Gerrit-PatchSet: 15
              Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
              Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
              Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
              Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
              Gerrit-Reviewer: qiu laidongfeng2 <26454...@qq.com>
              Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
              Gerrit-CC: Esra Al <esra....@gmail.com>
              Gerrit-CC: Garrett <garrett...@gmail.com>
              Gerrit-CC: Gopher Robot <go...@golang.org>
              Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
              Gerrit-Attention: qiu laidongfeng2 <26454...@qq.com>
              Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
              unsatisfied_requirement
              satisfied_requirement
              open
              diffy

              Manuel Sabin (Gerrit)

              unread,
              4:48 PM (5 hours ago) 4:48 PM
              to goph...@pubsubhelper.golang.org, Go LUCI, Roland Shoemaker, qiu laidongfeng2, Russell Webb, Clide Stefani, Esra Al, Garrett, Gopher Robot, golang-co...@googlegroups.com
              Attention needed from Filippo Valsorda, Roland Shoemaker and qiu laidongfeng2

              Manuel Sabin added 7 comments

              Commit Message
              Line 7, Patchset 13:crypto: add common tests for the hash.Hash interface
              Filippo Valsorda . resolved

              crypto/internal/cryptotest:

              Manuel Sabin

              Done

              Line 12, Patchset 13:tests to most of the crypto/ hash implementation test suites. It

              currently skips the hmac implementation since the keyed hash requires
              more setup.
              Filippo Valsorda . resolved

              old

              Manuel Sabin

              Done

              File src/crypto/internal/cryptotest/hash.go
              Line 96, Patchset 13: ctrlDigest := getSum(t, h, nil) //Record control digest
              Filippo Valsorda . resolved

              Space after //

              Manuel Sabin

              Done


              "Write returned error; got (%v, %v), want (nil, %v)",
              err, n, len(p))
              Filippo Valsorda . resolved

              nit: can be one line.

              Manuel Sabin

              Done

              Line 186, Patchset 13:func expectEqual(t *testing.T, got, want []byte, msg string) {
              Filippo Valsorda . resolved

              nit: inline this

              Manuel Sabin

              Done

              File src/go/build/deps_test.go
              Line 645, Patchset 11: bytes, hash, io, math/rand, testing, time
              Filippo Valsorda . resolved

              CRYPTO-MATH, testing

              Manuel Sabin

              Done

              Filippo Valsorda . resolved

              spurious

              Manuel Sabin

              Done

              Open in Gerrit

              Related details

              Attention is currently required from:
              • Filippo Valsorda
              • Roland Shoemaker
              • qiu laidongfeng2
              Submit Requirements:
              • requirement is not satisfiedCode-Review
              • requirement satisfiedNo-Unresolved-Comments
              • requirement is not satisfiedReview-Enforcement
              • requirement is not satisfiedTryBots-Pass
              Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
              Gerrit-MessageType: comment
              Gerrit-Project: go
              Gerrit-Branch: master
              Gerrit-Change-Id: Ic47086fd7f585e812c8b0d2186c50792c773781e
              Gerrit-Change-Number: 592855
              Gerrit-PatchSet: 15
              Gerrit-Owner: Manuel Sabin <msab...@gmail.com>
              Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
              Gerrit-Reviewer: Roland Shoemaker <rol...@golang.org>
              Gerrit-Reviewer: Russell Webb <russel...@protonmail.com>
              Gerrit-Reviewer: qiu laidongfeng2 <26454...@qq.com>
              Gerrit-CC: Clide Stefani <cstefan...@gmail.com>
              Gerrit-CC: Esra Al <esra....@gmail.com>
              Gerrit-CC: Garrett <garrett...@gmail.com>
              Gerrit-CC: Gopher Robot <go...@golang.org>
              Gerrit-Attention: Roland Shoemaker <rol...@golang.org>
              Gerrit-Attention: qiu laidongfeng2 <26454...@qq.com>
              Gerrit-Attention: Filippo Valsorda <fil...@golang.org>
              Gerrit-Comment-Date: Wed, 03 Jul 2024 20:48:09 +0000
              Gerrit-HasComments: Yes
              Gerrit-Has-Labels: No
              Comment-In-Reply-To: Filippo Valsorda <fil...@golang.org>
              unsatisfied_requirement
              satisfied_requirement
              open
              diffy
              Reply all
              Reply to author
              Forward
              0 new messages