summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/block/ofb_aes_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-12-15 15:33:31 -0800
committerRobert Griesemer <gri@golang.org>2009-12-15 15:33:31 -0800
commitd9527dd16f72598b54a64550607bf892efa12384 (patch)
tree2ad16a7db2d3c484b47426ad2568359ab633820c /src/pkg/crypto/block/ofb_aes_test.go
parentaea97e0bd7da9cef1cc631ddbd3578a0877a4fcc (diff)
downloadgolang-d9527dd16f72598b54a64550607bf892efa12384.tar.gz
1) Change default gofmt default settings for
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 1st set of files. R=rsc CC=agl, golang-dev, iant, ken2, r http://codereview.appspot.com/180047
Diffstat (limited to 'src/pkg/crypto/block/ofb_aes_test.go')
-rw-r--r--src/pkg/crypto/block/ofb_aes_test.go46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/pkg/crypto/block/ofb_aes_test.go b/src/pkg/crypto/block/ofb_aes_test.go
index 80af78fe4..f2faa4432 100644
--- a/src/pkg/crypto/block/ofb_aes_test.go
+++ b/src/pkg/crypto/block/ofb_aes_test.go
@@ -11,18 +11,18 @@
package block
import (
- "bytes";
- "crypto/aes";
- "io";
- "testing";
+ "bytes"
+ "crypto/aes"
+ "io"
+ "testing"
)
type ofbTest struct {
- name string;
- key []byte;
- iv []byte;
- in []byte;
- out []byte;
+ name string
+ key []byte
+ iv []byte
+ in []byte
+ out []byte
}
var ofbAESTests = []ofbTest{
@@ -67,20 +67,20 @@ var ofbAESTests = []ofbTest{
func TestOFB_AES(t *testing.T) {
for _, tt := range ofbAESTests {
- test := tt.name;
+ test := tt.name
- c, err := aes.NewCipher(tt.key);
+ c, err := aes.NewCipher(tt.key)
if err != nil {
- t.Errorf("%s: NewCipher(%d bytes) = %s", test, len(tt.key), err);
- continue;
+ t.Errorf("%s: NewCipher(%d bytes) = %s", test, len(tt.key), err)
+ continue
}
for j := 0; j <= 5; j += 5 {
- var crypt bytes.Buffer;
- in := tt.in[0 : len(tt.in)-j];
- w := NewOFBWriter(c, tt.iv, &crypt);
- var r io.Reader = bytes.NewBuffer(in);
- n, err := io.Copy(w, r);
+ var crypt bytes.Buffer
+ in := tt.in[0 : len(tt.in)-j]
+ w := NewOFBWriter(c, tt.iv, &crypt)
+ var r io.Reader = bytes.NewBuffer(in)
+ n, err := io.Copy(w, r)
if n != int64(len(in)) || err != nil {
t.Errorf("%s/%d: OFBWriter io.Copy = %d, %v want %d, nil", test, len(in), n, err, len(in))
} else if d, out := crypt.Bytes(), tt.out[0:len(in)]; !same(out, d) {
@@ -89,11 +89,11 @@ func TestOFB_AES(t *testing.T) {
}
for j := 0; j <= 7; j += 7 {
- var plain bytes.Buffer;
- out := tt.out[0 : len(tt.out)-j];
- r := NewOFBReader(c, tt.iv, bytes.NewBuffer(out));
- w := &plain;
- n, err := io.Copy(w, r);
+ var plain bytes.Buffer
+ out := tt.out[0 : len(tt.out)-j]
+ r := NewOFBReader(c, tt.iv, bytes.NewBuffer(out))
+ w := &plain
+ n, err := io.Copy(w, r)
if n != int64(len(out)) || err != nil {
t.Errorf("%s/%d: OFBReader io.Copy = %d, %v want %d, nil", test, len(out), n, err, len(out))
} else if d, in := plain.Bytes(), tt.in[0:len(out)]; !same(in, d) {