]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.24] crypto/internal/fips140/ecdsa: make TestingOnlyNewDRBG generic
authorFilippo Valsorda <filippo@golang.org>
Sun, 7 Sep 2025 14:44:43 +0000 (16:44 +0200)
committerJunyang Shao <shaojunyang@google.com>
Thu, 25 Sep 2025 19:14:01 +0000 (12:14 -0700)
We are re-sealing the .zip file anyway for another reason, might as well
take the opportunity to remove the fips140.Hash type indirection.

Updates #75523

Change-Id: I6a6a6964fdb312cc2c64e327f845c398c0f6279b
Reviewed-on: https://go-review.googlesource.com/c/go/+/701442
Reviewed-by: Roland Shoemaker <roland@golang.org>
Commit-Queue: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
TryBot-Bypass: Filippo Valsorda <filippo@golang.org>

src/crypto/internal/fips140/ecdsa/hmacdrbg.go

index 8f52091170249256a70ec9a78f035c1f5e4fb46f..5f05e50966e93a2899cbd0287edd92175c849d13 100644 (file)
@@ -121,7 +121,7 @@ func newDRBG[H fips140.Hash](hash func() H, entropy, nonce []byte, s personaliza
 //
 // This should only be used for ACVP testing. hmacDRBG is not intended to be
 // used directly.
-func TestingOnlyNewDRBG(hash func() fips140.Hash, entropy, nonce []byte, s []byte) *hmacDRBG {
+func TestingOnlyNewDRBG[H fips140.Hash](hash func() H, entropy, nonce []byte, s []byte) *hmacDRBG {
        return newDRBG(hash, entropy, nonce, plainPersonalizationString(s))
 }