Skip to content

Commit 7991da1

Browse files
committed
crypto/hpke: remove unused hybridKEM field
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]>
1 parent 2729e87 commit 7991da1

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/crypto/hpke/pq.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ var mlkem768X25519 = &hybridKEM{
3333
pqNewPrivateKey: func(data []byte) (crypto.Decapsulator, error) {
3434
return mlkem.NewDecapsulationKey768(data)
3535
},
36-
pqGenerateKey: func() (crypto.Decapsulator, error) {
37-
return mlkem.GenerateKey768()
38-
},
3936
}
4037

4138
// MLKEM768X25519 returns a KEM implementing MLKEM768-X25519 (a.k.a. X-Wing)
@@ -60,9 +57,6 @@ var mlkem768P256 = &hybridKEM{
6057
pqNewPrivateKey: func(data []byte) (crypto.Decapsulator, error) {
6158
return mlkem.NewDecapsulationKey768(data)
6259
},
63-
pqGenerateKey: func() (crypto.Decapsulator, error) {
64-
return mlkem.GenerateKey768()
65-
},
6660
}
6761

6862
// MLKEM768P256 returns a KEM implementing MLKEM768-P256 from draft-ietf-hpke-pq.
@@ -86,9 +80,6 @@ var mlkem1024P384 = &hybridKEM{
8680
pqNewPrivateKey: func(data []byte) (crypto.Decapsulator, error) {
8781
return mlkem.NewDecapsulationKey1024(data)
8882
},
89-
pqGenerateKey: func() (crypto.Decapsulator, error) {
90-
return mlkem.GenerateKey1024()
91-
},
9283
}
9384

9485
// MLKEM1024P384 returns a KEM implementing MLKEM1024-P384 from draft-ietf-hpke-pq.
@@ -108,7 +99,6 @@ type hybridKEM struct {
10899

109100
pqNewPublicKey func(data []byte) (crypto.Encapsulator, error)
110101
pqNewPrivateKey func(data []byte) (crypto.Decapsulator, error)
111-
pqGenerateKey func() (crypto.Decapsulator, error)
112102
}
113103

114104
func (kem *hybridKEM) ID() uint16 {

0 commit comments

Comments
 (0)