aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sha3/sha3.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/sha3/sha3.go b/sha3/sha3.go
index bda574e..4f5cadd 100644
--- a/sha3/sha3.go
+++ b/sha3/sha3.go
@@ -143,14 +143,14 @@ func (d *state) Read(out []byte) (n int, err error) {
// Now, do the squeezing.
for len(out) > 0 {
- x := copy(out, d.a[d.n:d.rate])
- d.n += x
- out = out[x:]
-
// Apply the permutation if we've squeezed the sponge dry.
if d.n == d.rate {
d.permute()
}
+
+ x := copy(out, d.a[d.n:d.rate])
+ d.n += x
+ out = out[x:]
}
return