Both polyfills have very similar logic so I push them in a single PR. They already follow the pattern I introduce in #92 - there's one generic implementation and the concrete implementations are just aliases existing to comply with our design.
This PR is based on #92 to make the diff show only the 2 commits that this PR actually adds. It's important to change the base back to main before merge and merge this PR after #92.
Details
Please check the logic of lsh and lshr functions in lsh.cairo and lshr.cairo files. Test cases are automatically generated (just like I did with and/or/xor) so they're most likely correct
Checklist
[x] Code is formatted by Rustfmt or scarb fmt.
~[ ] Documentation has been updated if necessary.~
Summary
Both polyfills have very similar logic so I push them in a single PR. They already follow the pattern I introduce in #92 - there's one generic implementation and the concrete implementations are just aliases existing to comply with our design.
This PR is based on #92 to make the diff show only the 2 commits that this PR actually adds. It's important to change the base back to
main
before merge and merge this PR after #92.Details
Please check the logic of
lsh
andlshr
functions inlsh.cairo
andlshr.cairo
files. Test cases are automatically generated (just like I did withand
/or
/xor
) so they're most likely correctChecklist
scarb fmt
.