summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/cipher/ctr_aes_test.go
diff options
context:
space:
mode:
authorAdam Langley <agl@golang.org>2012-02-13 12:38:45 -0500
committerAdam Langley <agl@golang.org>2012-02-13 12:38:45 -0500
commit685b0be0b29243051a33efa5902efa1012d03a94 (patch)
tree38ff51e06b2a0ed425969c48691d0bf8f1cd63ad /src/pkg/crypto/cipher/ctr_aes_test.go
parente5a06934cacfc1c7467f91fd643e9c5590241396 (diff)
downloadgo-685b0be0b29243051a33efa5902efa1012d03a94.tar.gz
crypto/...: more fixes for bug 2841
1) Remove the Reset() member in crypto/aes and crypto/des (and document the change). 2) Turn several empty error structures into vars. Any remaining error structures are either non-empty, or will probably become so in the future. 3) Implement SetWriteDeadline for TLS sockets. At the moment, the TLS status cannot be reused after a Write error, which is probably fine for most uses. 4) Make crypto/aes and crypto/des return a cipher.Block. R=rsc, r CC=golang-dev http://codereview.appspot.com/5625045
Diffstat (limited to 'src/pkg/crypto/cipher/ctr_aes_test.go')
-rw-r--r--src/pkg/crypto/cipher/ctr_aes_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pkg/crypto/cipher/ctr_aes_test.go b/src/pkg/crypto/cipher/ctr_aes_test.go
index 8dca9968c..d019ae0d0 100644
--- a/src/pkg/crypto/cipher/ctr_aes_test.go
+++ b/src/pkg/crypto/cipher/ctr_aes_test.go
@@ -8,11 +8,12 @@
// Special Publication 800-38A, ``Recommendation for Block Cipher
// Modes of Operation,'' 2001 Edition, pp. 55-58.
-package cipher
+package cipher_test
import (
"bytes"
"crypto/aes"
+ "crypto/cipher"
"testing"
)
@@ -76,7 +77,7 @@ func TestCTR_AES(t *testing.T) {
for j := 0; j <= 5; j += 5 {
in := tt.in[0 : len(tt.in)-j]
- ctr := NewCTR(c, tt.iv)
+ ctr := cipher.NewCTR(c, tt.iv)
encrypted := make([]byte, len(in))
ctr.XORKeyStream(encrypted, in)
if out := tt.out[0:len(in)]; !bytes.Equal(out, encrypted) {
@@ -86,7 +87,7 @@ func TestCTR_AES(t *testing.T) {
for j := 0; j <= 7; j += 7 {
in := tt.out[0 : len(tt.out)-j]
- ctr := NewCTR(c, tt.iv)
+ ctr := cipher.NewCTR(c, tt.iv)
plain := make([]byte, len(in))
ctr.XORKeyStream(plain, in)
if out := tt.in[0:len(in)]; !bytes.Equal(out, plain) {