Skip to content

Commit

Permalink
tls: rename Kyber<x>X25519 to X25519Kyber<x>Draft00 (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwesterb committed Aug 4, 2022
1 parent 7ecb308 commit e4f07a8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/crypto/tls/cfkem.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// [...]
//
// config.CurvePreferences = []tls.CurveID{
// hybrid.Kyber512X25519().(tls.TLSScheme).TLSCurveID(),
// hybrid.X25519Kyber512Draft00().(tls.TLSScheme).TLSCurveID(),
// tls.X25519,
// tls.P256,
// }
Expand All @@ -31,17 +31,17 @@ import (
type clientKeySharePrivate interface{}

var (
Kyber512X25519 = CurveID(0xfe30)
Kyber768X25519 = CurveID(0xfe31)
invalidCurveID = CurveID(0)
X25519Kyber512Draft00 = CurveID(0xfe30)
X25519Kyber768Draft00 = CurveID(0xfe31)
invalidCurveID = CurveID(0)
)

func kemSchemeKeyToCurveID(s kem.Scheme) CurveID {
switch s.Name() {
case "Kyber512-X25519":
return Kyber512X25519
return X25519Kyber512Draft00
case "Kyber768-X25519":
return Kyber768X25519
return X25519Kyber768Draft00
default:
return invalidCurveID
}
Expand All @@ -66,9 +66,9 @@ func clientKeySharePrivateCurveID(ks clientKeySharePrivate) CurveID {
// Returns scheme by CurveID if supported by Circl
func curveIdToCirclScheme(id CurveID) kem.Scheme {
switch id {
case Kyber512X25519:
case X25519Kyber512Draft00:
return hybrid.Kyber512X25519()
case Kyber768X25519:
case X25519Kyber768Draft00:
return hybrid.Kyber768X25519()
}
return nil
Expand Down

0 comments on commit e4f07a8

Please sign in to comment.