[Pkg-privacy-commits] [golang-siphash-dev] 04/23: Fix message length counting when padding with > 0 zeros.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:55:52 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository golang-siphash-dev.

commit bc8ae26098dab604c176112e0178bc740e0b3380
Author: Dmitry Chestnykh <dmitry at codingrobots.com>
Date:   Wed Jun 20 23:39:07 2012 +0200

    Fix message length counting when padding with > 0 zeros.
---
 siphash.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/siphash.go b/siphash.go
index 4d77a13..15579e3 100644
--- a/siphash.go
+++ b/siphash.go
@@ -19,9 +19,9 @@ const (
 	BlockSize = 8
 	// The size of hash output in bytes.
 	Size = 8
-	// Number of c iterations.
+	// The number of c iterations.
 	CRounds = 2
-	// Number of d iterations.
+	// The number of d iterations.
 	DRounds = 4
 )
 
@@ -119,8 +119,8 @@ func (d0 *digest) Sum64() uint64 {
 	d := *d0
 
 	var zeros [8]byte
-	d.Write(zeros[:7-d.nx])
 	d.t += uint8(d.nx)
+	d.Write(zeros[:7-d.nx])
 	d.Write([]byte{d.t})
 
 	v0, v1, v2, v3 := d.v0, d.v1, d.v2, d.v3

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/golang-siphash-dev.git



More information about the Pkg-privacy-commits mailing list