}
#G (r: number, i: number, a: number, b: number, c: number, d: number): void {
- this.#v[a] += this.#v[b] + this.#m[(this.constructor as typeof Blake2b).SIGMA[r][2 * i + 0]]
+ this.#v[a] += this.#v[b] + this.#m[(this.constructor as typeof Blake2b).SIGMA[r][i + i]]
this.#v[d] ^= this.#v[a]
this.#v[d] = (this.#v[d] >> 32n) | (this.#v[d] << 32n)
this.#v[c] += this.#v[d]
this.#v[b] ^= this.#v[c]
this.#v[b] = (this.#v[b] >> 24n) | (this.#v[b] << 40n)
- this.#v[a] += this.#v[b] + this.#m[(this.constructor as typeof Blake2b).SIGMA[r][2 * i + 1]]
+ this.#v[a] += this.#v[b] + this.#m[(this.constructor as typeof Blake2b).SIGMA[r][i + i + 1]]
this.#v[d] ^= this.#v[a]
this.#v[d] = (this.#v[d] >> 16n) | (this.#v[d] << 48n)
this.#v[c] += this.#v[d]
// copy input buffer to message block
const buf = new DataView(this.#b.buffer)
for (let i = 0; i < 16; i++) {
- this.#m[i] = buf.getBigUint64(i * 8, true)
+ this.#m[i] = buf.getBigUint64(i << 3, true)
}
// twelve rounds of mixing
// initialize hash state
for (let i = 0; i < 8; i++) {
- this.#h[i] = B.IV[i] ^ this.#parameter_view.getBigUint64(i * 8, true)
+ this.#h[i] = B.IV[i] ^ this.#parameter_view.getBigUint64(i << 3, true)
}
// key the hash, if applicable