diff options
Diffstat (limited to 'src/pkg/crypto/block/cipher.go')
-rw-r--r-- | src/pkg/crypto/block/cipher.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/pkg/crypto/block/cipher.go b/src/pkg/crypto/block/cipher.go index 1b786cca4..e1099e9a1 100644 --- a/src/pkg/crypto/block/cipher.go +++ b/src/pkg/crypto/block/cipher.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// The block package is deprecated, use cipher instead. // The block package implements standard block cipher modes // that can be wrapped around low-level block cipher implementations. // See http://csrc.nist.gov/groups/ST/toolkit/BCM/current_modes.html @@ -18,16 +19,16 @@ type Cipher interface { // Encrypt encrypts the first block in src into dst. // Src and dst may point at the same memory. - Encrypt(src, dst []byte) + Encrypt(dst, src []byte) // Decrypt decrypts the first block in src into dst. // Src and dst may point at the same memory. - Decrypt(src, dst []byte) + Decrypt(dst, src []byte) } // Utility routines -func shift1(src, dst []byte) byte { +func shift1(dst, src []byte) byte { var b byte for i := len(src) - 1; i >= 0; i-- { bb := src[i] >> 7 @@ -49,10 +50,8 @@ func same(p, q []byte) bool { return true } -func copy(p []byte) []byte { +func dup(p []byte) []byte { q := make([]byte, len(p)) - for i, b := range p { - q[i] = b - } + copy(q, p) return q } |