forked from quic-go/quic-go
speed up header encryption / decryption
This commit is contained in:
@@ -242,7 +242,7 @@ func (a *updatableAEAD) Overhead() int {
|
||||
}
|
||||
|
||||
func (a *updatableAEAD) EncryptHeader(sample []byte, firstByte *byte, pnBytes []byte) {
|
||||
if len(sample) != a.hpEncrypter.BlockSize() {
|
||||
if len(sample) != len(a.hpMask) {
|
||||
panic("invalid sample size")
|
||||
}
|
||||
a.hpEncrypter.Encrypt(a.hpMask, sample)
|
||||
@@ -253,7 +253,7 @@ func (a *updatableAEAD) EncryptHeader(sample []byte, firstByte *byte, pnBytes []
|
||||
}
|
||||
|
||||
func (a *updatableAEAD) DecryptHeader(sample []byte, firstByte *byte, pnBytes []byte) {
|
||||
if len(sample) != a.hpDecrypter.BlockSize() {
|
||||
if len(sample) != len(a.hpMask) {
|
||||
panic("invalid sample size")
|
||||
}
|
||||
a.hpDecrypter.Encrypt(a.hpMask, sample)
|
||||
|
||||
Reference in New Issue
Block a user