mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 20:26:19 +08:00
zuc: eea XORKeyStreamAt avoid useless calculation
This commit is contained in:
parent
9bfea6d73d
commit
0d56114869
@ -134,9 +134,11 @@ func (c *eea) XORKeyStreamAt(dst, src []byte, offset uint64) {
|
||||
}
|
||||
|
||||
// consumed all remaining key bytes first
|
||||
c.used += uint64(c.xLen)
|
||||
offsetDiff -= uint64(c.xLen)
|
||||
c.xLen = 0
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user