Update aead/poly1305

This commit is contained in:
Frank Denis 2018-04-16 02:19:29 +02:00
parent 5be294a6e2
commit 7685c12c0f
3 changed files with 13 additions and 8 deletions

View file

@ -1,8 +1,9 @@
language: go
go:
- 1.7
- 1.8
- "1.8.x"
- "1.9.x"
- "1.10.x"
env:
- TRAVIS_GOARCH=amd64
@ -13,4 +14,8 @@ before_install:
branches:
only:
- master
- master
script:
- diff -au <(gofmt -d .) <(printf "")
- go test -v ./...

View file

@ -138,7 +138,7 @@ func update(msg []byte, flag uint32, h, r *[5]uint32) {
r0, r1, r2, r3, r4 := uint64(r[0]), uint64(r[1]), uint64(r[2]), uint64(r[3]), uint64(r[4])
R1, R2, R3, R4 := r1*5, r2*5, r3*5, r4*5
for len(msg) > 0 {
for len(msg) >= TagSize {
// h += msg
h0 += binary.LittleEndian.Uint32(msg[0:]) & 0x3ffffff
h1 += (binary.LittleEndian.Uint32(msg[3:]) >> 2) & 0x3ffffff