forked from BlockstreamResearch/rust-simplicity
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixpoint.simpl
More file actions
32 lines (25 loc) · 734 Bytes
/
Copy pathfixpoint.simpl
File metadata and controls
32 lines (25 loc) · 734 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- Witnesses
-- IMR: [none]
wit_input := witness
-- All jets have source type 1; but to use the `pair` combinator we want one
-- with source type 2^256. To get this, we compose it with unit.
sha256_init : 2^256 -> _
sha256_init := comp unit jet_sha_256_ctx_8_init
-- Using this, we can write a self-contained "take 32 bytes and compute their
-- sha2 hash" function.
-- IMR: 8e341445...
sha256 : 2^256 -> 2^256
sha256 := comp
comp
pair sha256_init iden
jet_sha_256_ctx_8_add_32
jet_sha_256_ctx_8_finalize
-- Check eq
assert_fixpoint : 2^256 -> 1
assert_fixpoint := comp
comp
pair (comp iden sha256) iden
jet_eq_256
jet_verify
-- IMR: [none]
main := comp wit_input assert_fixpoint