remove unnecessary function

pull/97/head
v2ray 2016-02-23 18:25:00 +01:00
parent 87b15b2b20
commit 075423972b
1 changed files with 4 additions and 9 deletions

View File

@ -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()
}
}
}
func (s *ChaCha20Stream) advance() {
ChaCha20Block(&s.state, s.block[:], s.rounds)
s.offset = 0
s.state[12]++
ChaCha20Block(&s.state, s.block[:], s.rounds)
}
}
}