diff options
author | Adam Langley <agl@golang.org> | 2012-02-13 12:38:45 -0500 |
---|---|---|
committer | Adam Langley <agl@golang.org> | 2012-02-13 12:38:45 -0500 |
commit | 685b0be0b29243051a33efa5902efa1012d03a94 (patch) | |
tree | 38ff51e06b2a0ed425969c48691d0bf8f1cd63ad /src/pkg/crypto/cipher/ctr_aes_test.go | |
parent | e5a06934cacfc1c7467f91fd643e9c5590241396 (diff) | |
download | go-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.go | 7 |
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) { |