Skip to content

Commit

Permalink
feat(hints): Implements NewHint#12 (lambdaclass#1040)
Browse files Browse the repository at this point in the history
* Implemet hint 12 + add integration test

* Add changelog entry

* Add test file

* Unit tests

* Fix duplicated import leftover from merge

---------

Co-authored-by: Mario Rugiero <mario.rugiero@lambdaclass.com>
Co-authored-by: Mario Rugiero <mrugiero@gmail.com>
  • Loading branch information
3 people authored and kariy committed Jun 23, 2023
1 parent dfba972 commit fdf5cc0
Show file tree
Hide file tree
Showing 6 changed files with 785 additions and 1 deletion.
26 changes: 25 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,37 @@

#### Upcoming Changes

* Implement hint on cairo_blake2s whitelist [#1040](https://github.com/lambdaclass/cairo-rs/pull/1040)

`BuiltinHintProcessor` now supports the following hint:

```python
%{
from starkware.cairo.common.cairo_blake2s.blake2s_utils import IV, blake2s_compress

_blake2s_input_chunk_size_felts = int(ids.BLAKE2S_INPUT_CHUNK_SIZE_FELTS)
assert 0 <= _blake2s_input_chunk_size_felts < 100

new_state = blake2s_compress(
message=memory.get_range(ids.blake2s_start, _blake2s_input_chunk_size_felts),
h=[IV[0] ^ 0x01010020] + IV[1:],
t0=ids.n_bytes,
t1=0,
f0=0xffffffff,
f1=0,
)

segments.write_arg(ids.output, new_state)
%}
```

* Implement hint on cairo_blake2s whitelist [#1039](https://github.com/lambdaclass/cairo-rs/pull/1039)

`BuiltinHintProcessor` now supports the following hint:

```python

%{
%{
# Add dummy pairs of input and output.
from starkware.cairo.common.cairo_blake2s.blake2s_utils import IV, blake2s_compress

Expand Down
Loading

0 comments on commit fdf5cc0

Please sign in to comment.