-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
serde: implement
serialize_pointers
(#75)
Co-authored-by: Clément Walter <clement0walter@gmail.com>
- Loading branch information
1 parent
484f6b9
commit 2b58f55
Showing
3 changed files
with
2,586 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
%builtins output range_check bitwise | ||
|
||
from starkware.cairo.common.keccak_utils.keccak_utils import keccak_add_uint256 | ||
from starkware.cairo.common.uint256 import Uint256 | ||
from starkware.cairo.common.cairo_builtins import BitwiseBuiltin | ||
from starkware.cairo.common.alloc import alloc | ||
from starkware.cairo.common.serialize import serialize_word | ||
|
||
func main{output_ptr: felt*, range_check_ptr, bitwise_ptr: BitwiseBuiltin*}() { | ||
alloc_locals; | ||
|
||
let (inputs) = alloc(); | ||
let inputs_start = inputs; | ||
|
||
let num = Uint256(34623634663146736, 598249824422424658356); | ||
|
||
keccak_add_uint256{inputs=inputs_start}(num=num, bigend=0); | ||
|
||
assert inputs[0] = 34623634663146736; | ||
assert inputs[1] = 0; | ||
assert inputs[2] = 7954014063719006644; | ||
assert inputs[3] = 32; | ||
|
||
serialize_word(inputs[0]); | ||
serialize_word(inputs[1]); | ||
serialize_word(inputs[2]); | ||
serialize_word(inputs[3]); | ||
|
||
return (); | ||
} |
Oops, something went wrong.