mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 04:06:18 +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
|
// consumed all remaining key bytes first
|
||||||
c.used += uint64(c.xLen)
|
if c.xLen > 0 {
|
||||||
offsetDiff -= uint64(c.xLen)
|
c.used += uint64(c.xLen)
|
||||||
c.xLen = 0
|
offsetDiff -= uint64(c.xLen)
|
||||||
|
c.xLen = 0
|
||||||
|
}
|
||||||
|
|
||||||
// forward the state to the offset
|
// forward the state to the offset
|
||||||
stepLen := uint64(RoundBytes)
|
stepLen := uint64(RoundBytes)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user