-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
I feel better variable naming would look like
this. @Divide-By-0 any comments while I didn't start to apply it more widely?
- Loading branch information
Showing
1 changed file
with
16 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
251fba6
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.
Seems like a good start. I don't think hash1 or hash1_r are particularly more insightful; i like your point that hash1 and hash2 are bad names, can we improve that somehow? Also g and g_r are standard for generator, and generator and r_point seem inconsistent (i.e. maybe every* point should be labeled point or not)
251fba6
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.
@Divide-By-0 , Thanks for swift reply!
absolutely! =) just a mild improvement over
hash
while settling that in the issuehere I don't have a fine suggestion
maybe use full names like
hash_to_point
and "SHA256"?yep, I guess it's my personal tendency to avoid terms in code which are that unhelpful with full-text search
so, just leave
g_r
then? I thoughtr_scalar
andr_point
could be convenientalso didn't quite get second part in the parenthesis =(
thanks again for replying
I really feel like sort things out iteratively before further steps and "scaling" this along codebase
so further comments and approve are very welcome!
251fba6
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.
Hey, great thoughts.
hash_to_curve
is standard so that should be fine, we shouldn't enshrine sha256 in terminology since some i.e. Mina uses Poseidon. Maybehash_to_scalar
for that one?Good point, I like that.
Got it, I actually like that distinguishment. maybe rename g -> g_point and r -> r_point, and put r_scalar where relevant?
agreed
251fba6
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.
Correct me if I'm wrong: for systems with different tech we'll need to add suitable implementations. In this case verbal naming will be even more helpful:
hash_sha256
andhash_poseidon
immediately communicate quite some info.251fba6
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.
Btw, do you now get notifications here when not mentioned? @Divide-By-0
251fba6
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.
Yup.
Sounds good. Note that their poseidon hash and poseidon hash to curve are technically both poseidon hashes so might be ambiguous
251fba6
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.
251fba6
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.
One pass? What do you mean
251fba6
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.