mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
tests: fix sha1 test by fixing << | expressions with explicit parenthesis for now.
This commit is contained in:
@@ -55,7 +55,7 @@ fn block_generic(dig mut Digest, p_ []byte) {
|
||||
}
|
||||
for i < 20 {
|
||||
tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf]
|
||||
w[i&0xf] = tmp<<1 | (tmp>>(32-1))
|
||||
w[i&0xf] = (tmp<<1) | (tmp>>(32-1))
|
||||
f := b&c | (~b)&d
|
||||
t := bits.rotate_left_32(a, 5) + f + e + w[i&0xf] + u32(_k0)
|
||||
e = d
|
||||
@@ -67,7 +67,7 @@ fn block_generic(dig mut Digest, p_ []byte) {
|
||||
}
|
||||
for i < 40 {
|
||||
tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf]
|
||||
w[i&0xf] = tmp<<1 | (tmp>>(32-1))
|
||||
w[i&0xf] = (tmp<<1) | (tmp>>(32-1))
|
||||
f := b ^ c ^ d
|
||||
t := bits.rotate_left_32(a, 5) + f + e + w[i&0xf] + u32(_k1)
|
||||
e = d
|
||||
@@ -79,7 +79,7 @@ fn block_generic(dig mut Digest, p_ []byte) {
|
||||
}
|
||||
for i < 60 {
|
||||
tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf]
|
||||
w[i&0xf] = tmp<<1 | (tmp>>(32-1))
|
||||
w[i&0xf] = (tmp<<1) | (tmp>>(32-1))
|
||||
f := ((b | c) & d) | (b & c)
|
||||
t := bits.rotate_left_32(a, 5) + f + e + w[i&0xf] + u32(_k2)
|
||||
e = d
|
||||
@@ -91,7 +91,7 @@ fn block_generic(dig mut Digest, p_ []byte) {
|
||||
}
|
||||
for i < 80 {
|
||||
tmp := w[(i-3)&0xf] ^ w[(i-8)&0xf] ^ w[(i-14)&0xf] ^ w[(i)&0xf]
|
||||
w[i&0xf] = tmp<<1 | (tmp>>(32-1))
|
||||
w[i&0xf] = (tmp<<1) | (tmp>>(32-1))
|
||||
f := b ^ c ^ d
|
||||
t := bits.rotate_left_32(a, 5) + f + e + w[i&0xf] + u32(_k3)
|
||||
e = d
|
||||
|
Reference in New Issue
Block a user