NethermindEth / cairo-vm-go

A virtual machine for Cairo written in Go
MIT License
70 stars 43 forks source link

`RecoverY` hint (ecop builtin (STARK curve) related hint) #490

Closed TAdev0 closed 4 days ago

TAdev0 commented 1 week ago
    %{
        from starkware.crypto.signature.signature import ALPHA, BETA, FIELD_PRIME
        from starkware.python.math_utils import recover_y
        ids.p.x = ids.x
        # This raises an exception if `x` is not on the curve.
        ids.p.y = recover_y(ids.x, ALPHA, BETA, FIELD_PRIME)
    %}

https://github.com/starkware-libs/cairo-lang/blob/efa9648f57568aad8f8a13fbf027d2de7c63c2c0/src/starkware/cairo/common/ec.cairo#L259