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

Secp256k1 Cost annihilation #291

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

feltroidprime
Copy link

@feltroidprime feltroidprime commented Dec 18, 2024

signature verification costs divided by 25x

@feltroidprime feltroidprime marked this pull request as draft December 18, 2024 13:22
@feltroidprime feltroidprime marked this pull request as ready for review January 15, 2025 13:39
const POW_2_96 = 2 ** 96;

@known_ap_change
func get_generator_point() -> (point: G1Point) {
Copy link
Member

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) {
Copy link
Member

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) {
Copy link
Member

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?

@ClementWalter
Copy link
Member

why this @Eikix
image
@feltroidprime i think that the commit history of this branch is already quite bid, and squashed upon merge to main in any case, so you'd better squash everything and rebase from main

@Eikix
Copy link
Member

Eikix commented Jan 16, 2025

why this @Eikix image @feltroidprime i think that the commit history of this branch is already quite bid, and squashed upon merge to main in any case, so you'd better squash everything and rebase from main

i dont remember doing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants