Skip to content

Commit

Permalink
Unexport kyber in keysharekeys
Browse files Browse the repository at this point in the history
mingyech committed Jan 14, 2025
1 parent 1895b9c commit ff7af51
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion u_parrots.go
Original file line number Diff line number Diff line change
@@ -2758,7 +2758,7 @@ func (uconn *UConn) ApplyPreset(p *ClientHelloSpec) error {
ext.KeyShares[i].Data = append(ecdheKey.PublicKey().Bytes(), kyberKey.EncapsulationKey()...)
if !preferredCurveIsSet {
// only do this once for the first non-grease curve
uconn.HandshakeState.State13.KeyShareKeys.Kyber = kyberKey
uconn.HandshakeState.State13.KeyShareKeys.kyber = kyberKey
preferredCurveIsSet = true
}

6 changes: 3 additions & 3 deletions u_public.go
Original file line number Diff line number Diff line change
@@ -904,21 +904,21 @@ func (kpk *kemPrivateKey) ToPublic() *KemPrivateKey {
type KeySharePrivateKeys struct {
CurveID CurveID
Ecdhe *ecdh.PrivateKey
Kyber *mlkem768.DecapsulationKey
kyber *mlkem768.DecapsulationKey
}

func (ksp *KeySharePrivateKeys) ToPrivate() *keySharePrivateKeys {
return &keySharePrivateKeys{
curveID: ksp.CurveID,
ecdhe: ksp.Ecdhe,
kyber: ksp.Kyber,
kyber: ksp.kyber,
}
}

func (ksp *keySharePrivateKeys) ToPublic() *KeySharePrivateKeys {
return &KeySharePrivateKeys{
CurveID: ksp.curveID,
Ecdhe: ksp.ecdhe,
Kyber: ksp.kyber,
kyber: ksp.kyber,
}
}

0 comments on commit ff7af51

Please sign in to comment.