]> Cypherpunks.ru repositories - gogost.git/blob - mgm/slice.go
Download link for 5.14.1 release
[gogost.git] / mgm / slice.go
1 package mgm
2
3 // Taken from go/src/crypto/cipher/gcm.go
4 func sliceForAppend(in []byte, n int) (head, tail []byte) {
5         if total := len(in) + n; cap(in) >= total {
6                 head = in[:total]
7         } else {
8                 head = make([]byte, total)
9                 copy(head, in)
10         }
11         tail = head[len(in):]
12         return
13 }