Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Hints] ec_bigint.json #975

Closed
pefontana opened this issue Apr 13, 2023 · 2 comments
Closed

[New Hints] ec_bigint.json #975

pefontana opened this issue Apr 13, 2023 · 2 comments
Assignees
Labels
whitelisted-hint Implementation of hint on whitelist directory

Comments

@pefontana
Copy link
Collaborator

pefontana commented Apr 13, 2023

Implement the remaining hints in ec_bigint.json

NewHint#35

Assigned:
Status: todo

from starkware.cairo.common.cairo_secp.secp_utils import pack
from starkware.cairo.common.math_utils import as_int
from starkware.python.math_utils import div_mod, safe_div

p = pack(ids.P, PRIME)
x = pack(ids.x, PRIME) + as_int(ids.x.d3, PRIME) * ids.BASE ** 3 + as_int(ids.x.d4, PRIME) * ids.BASE ** 4
y = pack(ids.y, PRIME)

value = res = div_mod(x, y, p)

NewHint#36

Assigned:
Status: todo

k = safe_div(res * y - x, p)
value = k if k > 0 else 0 - k
ids.flag = 1 if k > 0 else 0
@pefontana pefontana moved this to Todo in Starknet Apr 13, 2023
@pefontana pefontana added the whitelisted-hint Implementation of hint on whitelist directory label Apr 13, 2023
@pefontana pefontana moved this from Todo to In Progress in Starknet Apr 20, 2023
@jpcenteno
Copy link
Contributor

Corporate needs you to find the differences between hint 35 and hint 36.

image

@jpcenteno
Copy link
Contributor

I fixed the issue description with the correct value for the NewHint#36. Got confirmation from @pefontana

@github-project-automation github-project-automation bot moved this from In Progress to Done in Starknet Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
whitelisted-hint Implementation of hint on whitelist directory
Projects
Status: Done
Development

No branches or pull requests

2 participants