-
Notifications
You must be signed in to change notification settings - Fork 14
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
Secp256k1 Cost annihilation #291
base: main
Are you sure you want to change the base?
Conversation
const POW_2_96 = 2 ** 96; | ||
|
||
@known_ap_change | ||
func get_generator_point() -> (point: G1Point) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could use a label
g1_point:
dw 0x2dce28d959f2815b16f81798
dw 0x55a06295ce870b07029bfcdb
dw 0x79be667ef9dcbbac
dw 0x0
dw 0xa68554199c47d08ffb10d4b8
dw 0x5da4fbfc0e1108a8fd17b448
dw 0x483ada7726a3c465
dw 0x0
and save the 8 steps to write `ret` data each call
} | ||
|
||
@known_ap_change | ||
func sign_to_UInt384_mod_secp256k1(sign: felt) -> (res: UInt384) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codebase specific, but return just the type, no need to make it a tuple (apply to all functions)
} | ||
|
||
// Assume the input is valid UInt384 (will be the case if coming from ModuloBuiltin) | ||
func uint384_to_uint256_mod_p{range_check_ptr}(a: UInt384, p: UInt384) -> (res: Uint256) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't there any missing constraints on P here?
why this @Eikix |
i dont remember doing this |
signature verification costs divided by 25x