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

61 #68

Merged
merged 12 commits into from
Nov 3, 2023
Merged

61 #68

merged 12 commits into from
Nov 3, 2023

Conversation

skaunov
Copy link
Collaborator

@skaunov skaunov commented Oct 22, 2023

Proposed solution. Sharing early for possible reviews; will be finishing presumably tomorrow.
All done.

(Note that I decided to go with it from #66 not to merge/rebase all that renaming again 🙄 )

[Discussion] results are incorporated. Naming groomed repository wide. \
Fun fact: I already was confused by that "hash2" naming, lol.

Note that `fn verify_signals` barely [benefit]
from renaming at all currently.

[Discussion]: 251fba6#commitcomment-130400727
[benefit]: #61
@skaunov skaunov linked an issue Oct 22, 2023 that may be closed by this pull request
@skaunov
Copy link
Collaborator Author

skaunov commented Oct 22, 2023

@Divide-By-0 , btw, I'm puzzled: does the other version of the scheme takes those two additional fields only together or any of one? Test coverage and the implementation under refactoring somewhat clashes.

PS also I should check if I didn't mess the struct naming...

@Divide-By-0
Copy link
Member

Divide-By-0 commented Oct 22, 2023

@Divide-By-0 , btw, I'm puzzled: does the other version of the scheme takes those two additional fields only together or any of one? Test coverage and the implementation under refactoring somewhat clashes.

Sorry I'm a bit confused what this means. Can you specify what the other scheme is (v2?) and what's any of one field mean? Not sure what is the scheme under implementation or what the tests cover but feel free to choose what is most intuitive and passes the circom circuit test as well.

Naming I don't know if you got everything but it seems reasonable, if tests pass then it should be fine.

There should be no package lock, please use yarn.

@skaunov
Copy link
Collaborator Author

skaunov commented Oct 22, 2023

Sorry, I was writing from Android that one. 😅

I indeed confused V1 and V2 naming -- will straight now.

the question

I tried to formulate the question, and it's still too wordy and confusing. Let me ask it with a link better.

r_point_optional: &Option<ProjectivePoint>,
it optionally takes r_point and hashed_to_curve and takes version (V1/V2).

So I made it quite restrictive oriented by the tests: if you supply these optional values, then your version is V1. You can't supply only one of the values, absence of values set version to V2.

But today I just thought that the logic could be different and it's ok to supply that values, verify them, but still be using V2; or supply V2 c for verification along with one of the optional values. If so, I would say these would be good to be covered by tests too.

@Divide-By-0
Copy link
Member

Yeah, seems fine to put in those values in V2 as well, it'll make migration easier.

@skaunov
Copy link
Collaborator Author

skaunov commented Oct 22, 2023

tried such approach locally: and it doesn't look that good as it sounds =(
makes API of the function really messy

it looks much better to add additional functions to verify these V1 fields with V2 sig
if we want to cover it

other way it's a mess when that optional or not on input
and yields complex output to communicate if sig is verified ok V2, but additional V1 info is not %)

and I better keep output simple bool

@skaunov skaunov marked this pull request as ready for review October 22, 2023 21:13
`Digest` had been switched to more robust re-exported version.
`ring` seems to be excessive, commented out for now
@Divide-By-0 Divide-By-0 merged commit cac9b4c into main Nov 3, 2023
5 checks passed
@Divide-By-0
Copy link
Member

Sorry about the delay here! Thanks for the renaming.

@skaunov skaunov deleted the 61 branch November 3, 2023 10:19
@skaunov
Copy link
Collaborator Author

skaunov commented Nov 3, 2023

Sorry about the delay here! Thanks for the renaming.

Cool! Though I don't remember renaming per se there, only when needed for code refactoring.

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.

Refactor verify_signals
2 participants