summaryrefslogtreecommitdiff
path: root/src/pkg/crypto/md5/md5.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/crypto/md5/md5.go')
-rw-r--r--src/pkg/crypto/md5/md5.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/pkg/crypto/md5/md5.go b/src/pkg/crypto/md5/md5.go
index 383466588..5194ccd7c 100644
--- a/src/pkg/crypto/md5/md5.go
+++ b/src/pkg/crypto/md5/md5.go
@@ -52,11 +52,11 @@ func (d *digest) Write(p []byte) (nn int, err os.Error) {
d.len += uint64(nn);
if d.nx > 0 {
n := len(p);
- if n > _Chunk - d.nx {
+ if n > _Chunk-d.nx {
n = _Chunk - d.nx
}
for i := 0; i < n; i++ {
- d.x[d.nx + i] = p[i]
+ d.x[d.nx+i] = p[i]
}
d.nx += n;
if d.nx == _Chunk {
@@ -82,15 +82,15 @@ func (d *digest) Sum() []byte {
var tmp [64]byte;
tmp[0] = 0x80;
if len%64 < 56 {
- d.Write(tmp[0 : 56 - len%64])
+ d.Write(tmp[0 : 56-len%64])
} else {
- d.Write(tmp[0 : 64 + 56 - len%64])
+ d.Write(tmp[0 : 64+56-len%64])
}
// Length in bits.
len <<= 3;
for i := uint(0); i < 8; i++ {
- tmp[i] = byte(len>>(8*i))
+ tmp[i] = byte(len >> (8 * i))
}
d.Write(tmp[0:8]);
@@ -104,11 +104,11 @@ func (d *digest) Sum() []byte {
s := d.s[i];
p[j] = byte(s);
j++;
- p[j] = byte(s>>8);
+ p[j] = byte(s >> 8);
j++;
- p[j] = byte(s>>16);
+ p[j] = byte(s >> 16);
j++;
- p[j] = byte(s>>24);
+ p[j] = byte(s >> 24);
j++;
}
return p;