Skip to content

Commit

Permalink
examples/sha1: forgot to regenerate README
Browse files Browse the repository at this point in the history
  • Loading branch information
mmcloughlin committed Jan 11, 2019
1 parent d0357fa commit 8543268
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/sha1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ func main() {
w := AllocLocal(64)
W := func(r int) Mem { return w.Offset((r % 16) * 4) }

// Load initial hash.
Comment("Load initial hash.")
hash := [5]Register{GP32(), GP32(), GP32(), GP32(), GP32()}
for i, r := range hash {
MOVL(h.Offset(4*i), r)
}

// Initialize registers.
Comment("Initialize registers.")
a, b, c, d, e := GP32(), GP32(), GP32(), GP32(), GP32()
for i, r := range []Register{a, b, c, d, e} {
MOVL(hash[i], r)
Expand All @@ -40,6 +40,7 @@ func main() {
}

for r := 0; r < 80; r++ {
Commentf("Round %d.", r)
q := quarter[r/20]

// Load message value.
Expand Down Expand Up @@ -70,12 +71,12 @@ func main() {
a, b, c, d, e = t, a, b, c, d
}

// Final add.
Comment("Final add.")
for i, r := range []Register{a, b, c, d, e} {
ADDL(r, hash[i])
}

// Store results back.
Comment("Store results back.")
for i, r := range hash {
MOVL(r, h.Offset(4*i))
}
Expand Down

0 comments on commit 8543268

Please sign in to comment.