Skip to content

Commit

Permalink
Do a loop in keccak-lys
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Jul 31, 2019
1 parent 79349a6 commit b936fc0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 2 additions & 4 deletions keccak-lys.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ shard_pre_state:
- "0000000000000000000000000000000000000000000000000000000000000000"
shard_blocks:
- env: 0
data: ""
- env: 0
data: ""
data: "00000000000000000000000000000000000000000000000000000000000000ff"
shard_post_state:
exec_env_states:
- "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470"
- "9f1c3493f670fb5a4611e82d5bbb06eb4969a406ecc1e47c0dca6f5ce354d187"
10 changes: 9 additions & 1 deletion scripts/keccak-lys/main.lys
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ fun main(): void = {
blockDataCopy(input.ptr, 0 as u32, len)

var k = Keccak()
Keccak.update(k, input)
var i = 0
loop {
if (i < 256) {
i = i + 1
Keccak.update(k, input)
continue
}
break
}
var ret = Keccak.digest(k)

savePostStateRoot(ret.ptr)
Expand Down

0 comments on commit b936fc0

Please sign in to comment.