forked from quic-go/quic-go
introduce an absolute key phase, use it for key updates
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
package protocol
|
||||
|
||||
// KeyPhase is the key phase
|
||||
type KeyPhase uint64
|
||||
|
||||
func (p KeyPhase) Bit() KeyPhaseBit {
|
||||
return p%2 == 1
|
||||
}
|
||||
|
||||
// KeyPhaseBit is the key phase bit
|
||||
type KeyPhaseBit bool
|
||||
|
||||
@@ -16,7 +23,3 @@ func (p KeyPhaseBit) String() string {
|
||||
}
|
||||
return "1"
|
||||
}
|
||||
|
||||
func (p KeyPhaseBit) Next() KeyPhaseBit {
|
||||
return !p
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user