File tree 1 file changed +4
-4
lines changed
extensions/bigint/guest/src
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -133,7 +133,7 @@ pub unsafe extern "C" fn zkvm_u256_eq_impl(a: *const u8, b: *const u8) -> bool {
133
133
134
134
#[ no_mangle]
135
135
pub unsafe extern "C" fn zkvm_u256_cmp_impl ( a : * const u8 , b : * const u8 ) -> Ordering {
136
- let mut cmp_result = MaybeUninit :: < crate :: U256 > :: uninit ( ) ;
136
+ let mut cmp_result = MaybeUninit :: < [ u8 ; 32 ] > :: uninit ( ) ;
137
137
custom_insn_r ! (
138
138
opcode = OPCODE ,
139
139
funct3 = INT256_FUNCT3 ,
@@ -143,7 +143,7 @@ pub unsafe extern "C" fn zkvm_u256_cmp_impl(a: *const u8, b: *const u8) -> Order
143
143
rs2 = In b as * const u8
144
144
) ;
145
145
let mut cmp_result = cmp_result. assume_init ( ) ;
146
- if cmp_result. as_le_bytes ( ) [ 0 ] != 0 {
146
+ if cmp_result[ 0 ] != 0 {
147
147
return Ordering :: Less ;
148
148
}
149
149
custom_insn_r ! (
@@ -154,15 +154,15 @@ pub unsafe extern "C" fn zkvm_u256_cmp_impl(a: *const u8, b: *const u8) -> Order
154
154
rs1 = In b as * const u8 ,
155
155
rs2 = In a as * const u8
156
156
) ;
157
- if cmp_result. as_le_bytes ( ) [ 0 ] != 0 {
157
+ if cmp_result[ 0 ] != 0 {
158
158
return Ordering :: Greater ;
159
159
}
160
160
return Ordering :: Equal ;
161
161
}
162
162
163
163
#[ no_mangle]
164
164
pub unsafe extern "C" fn zkvm_u256_clone_impl ( result : * mut u8 , a : * const u8 ) {
165
- let zero = & crate :: U256 :: ZERO as * const _ as * const u8 ;
165
+ let zero = & [ 0u8 ; 32 ] as * const _ as * const u8 ;
166
166
custom_insn_r ! (
167
167
opcode = OPCODE ,
168
168
funct3 = INT256_FUNCT3 ,
You can’t perform that action at this time.
0 commit comments