summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/cipher/ofb_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/ofb_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/ofb_test.go')
-rw-r--r--src/pkg/crypto/cipher/ofb_test.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pkg/crypto/cipher/ofb_test.go b/src/pkg/crypto/cipher/ofb_test.go
index 9b4495c88..8d3c5d3a3 100644
--- a/src/pkg/crypto/cipher/ofb_test.go
+++ b/src/pkg/crypto/cipher/ofb_test.go
@@ -8,11 +8,12 @@
// Special Publication 800-38A, ``Recommendation for Block Cipher
// Modes of Operation,'' 2001 Edition, pp. 52-55.
-package cipher
+package cipher_test
import (
"bytes"
"crypto/aes"
+ "crypto/cipher"
"testing"
)
@@ -76,7 +77,7 @@ func TestOFB(t *testing.T) {
for j := 0; j <= 5; j += 5 {
plaintext := tt.in[0 : len(tt.in)-j]
- ofb := NewOFB(c, tt.iv)
+ ofb := cipher.NewOFB(c, tt.iv)
ciphertext := make([]byte, len(plaintext))
ofb.XORKeyStream(ciphertext, plaintext)
if !bytes.Equal(ciphertext, tt.out[:len(plaintext)]) {
@@ -86,7 +87,7 @@ func TestOFB(t *testing.T) {
for j := 0; j <= 5; j += 5 {
ciphertext := tt.out[0 : len(tt.in)-j]
- ofb := NewOFB(c, tt.iv)
+ ofb := cipher.NewOFB(c, tt.iv)
plaintext := make([]byte, len(ciphertext))
ofb.XORKeyStream(plaintext, ciphertext)
if !bytes.Equal(plaintext, tt.in[:len(ciphertext)]) {