Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bitcoin-script-riscv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
bitcoin-script-stack = { git = "https://github.com/FairgateLabs/rust-bitcoin-script-stack", features = [
"interactive",
], branch = "v2" }
bitcoin-script-functions = { git = "https://github.com/FairgateLabs/rust-bitcoin-script-functions" }
bitcoin-script-functions = { git = "https://github.com/FairgateLabs/rust-bitcoin-script-functions"}
bitcoin = "=0.32.6"
bitcoin-script = { git = "https://github.com/FairgateLabs/rust-bitcoin-script", branch = "bitvmx" }
riscv-decode = "0.2.1"
Expand Down
6 changes: 3 additions & 3 deletions bitcoin-script-riscv/src/riscv/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub fn mask_4bit(stack: &mut StackTracker) -> StackVariable {
0x8
OP_SUB
OP_ENDIF
},
}.compile(),
1,
true,
0,
Expand Down Expand Up @@ -124,7 +124,7 @@ pub fn decode_i_type(
OP_1
OP_ENDIF
OP_VERIFY
},
}.compile(),
1,
false,
0,
Expand Down Expand Up @@ -190,7 +190,7 @@ pub fn decode_b_type(
0
OP_TOALTSTACK
ENDIF
},
}.compile(),
1,
false,
1,
Expand Down
23 changes: 11 additions & 12 deletions bitcoin-script-riscv/src/riscv/script_utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use bitcoin_script_stack::stack::{StackTracker, StackVariable};

pub use bitcoin_script::{define_pushable, script};
define_pushable!();
pub use bitcoin_script::script;
pub use bitcoin::ScriptBuf as Script;
use bitvmx_cpu_definitions::memory::{Chunk, MemoryAccessType, SectionDefinition};

Expand Down Expand Up @@ -58,7 +57,7 @@ pub fn nib_to_bin(stack: &mut StackTracker) {
0
OP_ENDIF
OP_TOALTSTACK
},
}.compile(),
1,
false,
1,
Expand Down Expand Up @@ -180,7 +179,7 @@ pub fn if_greater(stack: &mut StackTracker, than: u8, then: u8, else_: u8) -> St
OP_ELSE
{ else_}
OP_ENDIF
},
}.compile(),
1,
true,
0,
Expand All @@ -200,7 +199,7 @@ pub fn if_less(stack: &mut StackTracker, than: u8, then: u8, else_: u8) -> Stack
OP_ELSE
{ else_}
OP_ENDIF
},
}.compile(),
1,
true,
0,
Expand All @@ -226,7 +225,7 @@ pub fn sub_1_if_positive(stack: &mut StackTracker) -> StackVariable {
0
OP_ENDIF
OP_TOALTSTACK
},
}.compile(),
0,
true,
0,
Expand All @@ -249,7 +248,7 @@ pub fn choose(stack: &mut StackTracker) -> StackVariable {
OP_ROLL
OP_SWAP
OP_DROP
},
}.compile(),
3,
true,
0,
Expand Down Expand Up @@ -689,7 +688,7 @@ pub fn is_lower_than(
{ -n }
OP_ENDIF
OP_ENDIF
},
}.compile(),
3,
true,
0,
Expand Down Expand Up @@ -718,7 +717,7 @@ pub fn is_lower_than(
{ -n }
OP_ENDIF
OP_ENDIF
},
}.compile(),
3,
true,
0,
Expand Down Expand Up @@ -767,7 +766,7 @@ pub fn mask_value(
OP_DROP
0
OP_ENDIF
},
}.compile(),
2,
true,
0,
Expand Down Expand Up @@ -850,7 +849,7 @@ pub fn left_rotate(
for _ in 0..4 {
OP_2DROP
}
},
}.compile(),
17,
false,
8,
Expand Down Expand Up @@ -1077,7 +1076,7 @@ pub fn mulh(
stack.op_rot(); //a1 b1 b1 a1
stack.op_add(); //a1 b1 a1+b1
stack
.custom(script! { 1 OP_EQUAL }, 1, true, 0, "result_neg")
.custom(script! { 1 OP_EQUAL }.compile(), 1, true, 0, "result_neg")
.unwrap();
stack.to_altstack(); //a1 b1 | a1+b1
}
Expand Down