mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
remove unnecessary function
This commit is contained in:
@@ -44,7 +44,7 @@ func NewChaCha20Stream(key []byte, nonce []byte, rounds int) *ChaCha20Stream {
|
||||
}
|
||||
|
||||
s.rounds = rounds
|
||||
s.advance()
|
||||
ChaCha20Block(&s.state, s.block[:], s.rounds)
|
||||
return s
|
||||
}
|
||||
|
||||
@@ -72,14 +72,9 @@ func (s *ChaCha20Stream) XORKeyStream(dst, src []byte) {
|
||||
s.offset = o
|
||||
|
||||
if o == blockSize {
|
||||
s.advance()
|
||||
s.offset = 0
|
||||
s.state[12]++
|
||||
ChaCha20Block(&s.state, s.block[:], s.rounds)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (s *ChaCha20Stream) advance() {
|
||||
ChaCha20Block(&s.state, s.block[:], s.rounds)
|
||||
|
||||
s.offset = 0
|
||||
s.state[12]++
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user