]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/hpke: remove unused hybridKEM field
authorqmuntal <quimmuntal@gmail.com>
Wed, 3 Dec 2025 11:32:15 +0000 (12:32 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Wed, 3 Dec 2025 16:23:24 +0000 (08:23 -0800)
hybridKEM.pqGenerateKey is not used anywhere. Having it around
is confusing, as it suggests that the mlkem seed is generated within
the mlkem package, when it is not.

Change-Id: Ie0bdb79d6b774db7b21dfff2b966452463f1ce08
Reviewed-on: https://go-review.googlesource.com/c/go/+/726260
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/crypto/hpke/pq.go

index a79dadf58f310cb75f253102ddcd3d798506cef7..f2adbef54ea808053976fcfce54c70c173698246 100644 (file)
@@ -33,9 +33,6 @@ var mlkem768X25519 = &hybridKEM{
        pqNewPrivateKey: func(data []byte) (crypto.Decapsulator, error) {
                return mlkem.NewDecapsulationKey768(data)
        },
-       pqGenerateKey: func() (crypto.Decapsulator, error) {
-               return mlkem.GenerateKey768()
-       },
 }
 
 // MLKEM768X25519 returns a KEM implementing MLKEM768-X25519 (a.k.a. X-Wing)
@@ -60,9 +57,6 @@ var mlkem768P256 = &hybridKEM{
        pqNewPrivateKey: func(data []byte) (crypto.Decapsulator, error) {
                return mlkem.NewDecapsulationKey768(data)
        },
-       pqGenerateKey: func() (crypto.Decapsulator, error) {
-               return mlkem.GenerateKey768()
-       },
 }
 
 // MLKEM768P256 returns a KEM implementing MLKEM768-P256 from draft-ietf-hpke-pq.
@@ -86,9 +80,6 @@ var mlkem1024P384 = &hybridKEM{
        pqNewPrivateKey: func(data []byte) (crypto.Decapsulator, error) {
                return mlkem.NewDecapsulationKey1024(data)
        },
-       pqGenerateKey: func() (crypto.Decapsulator, error) {
-               return mlkem.GenerateKey1024()
-       },
 }
 
 // MLKEM1024P384 returns a KEM implementing MLKEM1024-P384 from draft-ietf-hpke-pq.
@@ -108,7 +99,6 @@ type hybridKEM struct {
 
        pqNewPublicKey  func(data []byte) (crypto.Encapsulator, error)
        pqNewPrivateKey func(data []byte) (crypto.Decapsulator, error)
-       pqGenerateKey   func() (crypto.Decapsulator, error)
 }
 
 func (kem *hybridKEM) ID() uint16 {