Skip to content

Commit

Permalink
[dev.boringcrypto] all: merge master (more nearly Go 1.10 beta 1) int…
Browse files Browse the repository at this point in the history
…o dev.boringcrypto

This merge picks up the new marshal tests in package hash.

Change-Id: I50136ad4953c64d776d28f13b37470ea884cb8dd
  • Loading branch information
rsc committed Dec 6, 2017
2 parents 185e609 + 1d547e4 commit 5379f78
Show file tree
Hide file tree
Showing 6 changed files with 147 additions and 36 deletions.
3 changes: 2 additions & 1 deletion src/crypto/md5/md5.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ func (d *digest) MarshalBinary() ([]byte, error) {
b = appendUint32(b, d.s[1])
b = appendUint32(b, d.s[2])
b = appendUint32(b, d.s[3])
b = append(b, d.x[:]...)
b = append(b, d.x[:d.nx]...)
b = b[:len(b)+len(d.x)-int(d.nx)] // already zero
b = appendUint64(b, d.len)
return b, nil
}
Expand Down
3 changes: 2 additions & 1 deletion src/crypto/sha1/sha1.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ func (d *digest) MarshalBinary() ([]byte, error) {
b = appendUint32(b, d.h[2])
b = appendUint32(b, d.h[3])
b = appendUint32(b, d.h[4])
b = append(b, d.x[:]...)
b = append(b, d.x[:d.nx]...)
b = b[:len(b)+len(d.x)-int(d.nx)] // already zero
b = appendUint64(b, d.len)
return b, nil
}
Expand Down
Loading

0 comments on commit 5379f78

Please sign in to comment.