mirror of
https://github.com/rclone/rclone.git
synced 2026-01-06 10:33:34 +00:00
vendor: update all dependencies
This commit is contained in:
9
vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go
generated
vendored
9
vendor/golang.org/x/crypto/internal/chacha20/chacha_generic.go
generated
vendored
@@ -9,6 +9,8 @@ package chacha20
|
||||
import (
|
||||
"crypto/cipher"
|
||||
"encoding/binary"
|
||||
|
||||
"golang.org/x/crypto/internal/subtle"
|
||||
)
|
||||
|
||||
// assert that *Cipher implements cipher.Stream
|
||||
@@ -41,6 +43,13 @@ func New(key [8]uint32, nonce [3]uint32) *Cipher {
|
||||
// the src buffers was passed in a single run. That is, Cipher
|
||||
// maintains state and does not reset at each XORKeyStream call.
|
||||
func (s *Cipher) XORKeyStream(dst, src []byte) {
|
||||
if len(dst) < len(src) {
|
||||
panic("chacha20: output smaller than input")
|
||||
}
|
||||
if subtle.InexactOverlap(dst[:len(src)], src) {
|
||||
panic("chacha20: invalid buffer overlap")
|
||||
}
|
||||
|
||||
// xor src with buffered keystream first
|
||||
if s.len != 0 {
|
||||
buf := s.buf[len(s.buf)-s.len:]
|
||||
|
||||
Reference in New Issue
Block a user