Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Oct 3, 2023
1 parent d7004d9 commit c55aefd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cairo_programs/finalize_blake2s.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
%builtins range_check bitwise

from starkware.cairo.common.alloc import alloc
from starkware.cairo.common.cairo_blake2s.blake2s import blake2s, finalize_blake2s
from starkware.cairo.common.cairo_builtins import BitwiseBuiltin

func main{range_check_ptr, bitwise_ptr: BitwiseBuiltin*}() {
alloc_locals;
let inputs: felt* = alloc();
assert inputs[0] = 'Hell';
assert inputs[1] = 'o Wo';
assert inputs[2] = 'rld';
let (local blake2s_ptr_start) = alloc();
let blake2s_ptr = blake2s_ptr_start;
let (output) = blake2s{range_check_ptr=range_check_ptr, blake2s_ptr=blake2s_ptr}(inputs, 9);
finalize_blake2s(blake2s_ptr_start, blake2s_ptr);
return ();
}
4 changes: 4 additions & 0 deletions pkg/vm/cairo_run/cairo_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,7 @@ func TestBlake2sHelloWorldHash(t *testing.T) {
func TestBlake2sFelts(t *testing.T) {
testProgram("blake2s_felts", t)
}

func TestFinalizeBlake2s(t *testing.T) {
testProgram("finalize_blake2s", t)
}

0 comments on commit c55aefd

Please sign in to comment.