1
0
mirror of https://github.com/fumiama/blake2b-simd.git synced 2026-06-09 20:40:28 +08:00

internal: use arrays instead of make for simple values. (#22)

Fixes #16
This commit is contained in:
Harshavardhana
2016-07-22 02:38:12 -07:00
committed by Frank
parent 326c321661
commit c50cace0dc
5 changed files with 26 additions and 22 deletions

View File

@@ -26,12 +26,13 @@ func compressGeneric(d *digest, p []uint8) {
v13 := iv[5] ^ d.t[1]
v14 := iv[6] ^ d.f[0]
v15 := iv[7] ^ d.f[1]
var m [16]uint64
j := 0
for i := 0; i < 16; i++ {
m[i] = uint64(p[j]) | uint64(p[j+1])<<8 | uint64(p[j+2])<<16 | uint64(p[j+3])<<24 |
uint64(p[j+4])<<32 | uint64(p[j+5])<<40 | uint64(p[j+6])<<48 | uint64(p[j+7])<<56
var m [16]uint64
for i := range m {
m[i] = uint64(p[j]) | uint64(p[j+1])<<8 | uint64(p[j+2])<<16 |
uint64(p[j+3])<<24 | uint64(p[j+4])<<32 | uint64(p[j+5])<<40 |
uint64(p[j+6])<<48 | uint64(p[j+7])<<56
j += 8
}