diff --git a/blog/recovering-garbled-bitcoin-addresses/index.html b/blog/recovering-garbled-bitcoin-addresses/index.html index e510222..0463172 100644 --- a/blog/recovering-garbled-bitcoin-addresses/index.html +++ b/blog/recovering-garbled-bitcoin-addresses/index.html @@ -989,7 +989,7 @@ let s1 = rotate_right(w[i - 2], 17) ^ rotate_right(w[i - 2], 19) ^ (w[i - 2] >> 10); w[i] = w[i - 16] + s0 + w[i - 7] + s1; } -
sha256msg1
computes w[i - 16] + s0
for for consecutive i
s. sha256msg2
would compute w[i - 7] + s1
for four consecutive i
s, if only w[i]
didn’t depend on w[i - 2]
, so instead of computes w[i]
given the result of sha256msg1
and the previous values of w
. Here is how they are meant to be used, roughly speaking:
for i in (16..64).step_by(4) {
+
sha256msg1
computes w[i - 16] + s0
for four consecutive i
s. sha256msg2
would compute w[i - 7] + s1
for four consecutive i
s, if only w[i]
didn’t depend on w[i - 2]
, so instead of computes w[i]
given the result of sha256msg1
and the previous values of w
. Here is how they are meant to be used, roughly speaking:
for i in (16..64).step_by(4) {
w[i..i + 4] = sha256msg2(sha256msg1(w[i - 16..i - 12], w[i - 12..i - 8]) + w[i - 7..i - 3], w[i - 4..i]);
}
sha256rnds2
performs two rounds of the main loop of SHA-256, meaning that this:
for i in (0..64).step_by(8) {
diff --git a/blog/recovering-garbled-bitcoin-addresses/index.md b/blog/recovering-garbled-bitcoin-addresses/index.md
index d8cdc9c..090a7fa 100644
--- a/blog/recovering-garbled-bitcoin-addresses/index.md
+++ b/blog/recovering-garbled-bitcoin-addresses/index.md
@@ -1589,7 +1589,7 @@ for i in 16..64 {
}
```
-`sha256msg1` computes `w[i - 16] + s0` for for consecutive `i`s. `sha256msg2` *would* compute `w[i - 7] + s1` for four consecutive `i`s, if only `w[i]` didn't depend on `w[i - 2]`, so instead of computes `w[i]` given the result of `sha256msg1` and the previous values of `w`. Here is how they are meant to be used, roughly speaking:
+`sha256msg1` computes `w[i - 16] + s0` for four consecutive `i`s. `sha256msg2` *would* compute `w[i - 7] + s1` for four consecutive `i`s, if only `w[i]` didn't depend on `w[i - 2]`, so instead of computes `w[i]` given the result of `sha256msg1` and the previous values of `w`. Here is how they are meant to be used, roughly speaking:
```rust
for i in (16..64).step_by(4) {