zuc: eea XORKeyStreamAt avoid useless calculation

This commit is contained in:
Sun Yimin 2024-12-05 18:13:23 +08:00 committed by GitHub
parent 9bfea6d73d
commit 0d56114869
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -134,9 +134,11 @@ func (c *eea) XORKeyStreamAt(dst, src []byte, offset uint64) {
}
// consumed all remaining key bytes first
if c.xLen > 0 {
c.used += uint64(c.xLen)
offsetDiff -= uint64(c.xLen)
c.xLen = 0
}
// forward the state to the offset
stepLen := uint64(RoundBytes)