-
Notifications
You must be signed in to change notification settings - Fork 144
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
group: removes order method from group interface #356
Conversation
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.
Since the group order is public and well-know for the groups supported, then it's better to remove the method.
This is precisely why we want to keep the function on the Group interface. Applications should not need to bake this into their code, possibly getting it wrong. (I could see them confusing the underlying field order with the group's order, for example.) They should just call the Order
function on the desired group's interface.
The current I think it's bad to return a Let's step back: for what reasons would the user need the order and can we provide functions directly for those use-cases instead? |
Say more?
The existing use cases we have are for determining scalar validity during deserialization, but that should already be covered by the deserialize functions on the Scalar interface. I don't know of any other uses, but as above, I don't think it's a good idea to punt this to applications should they need to use it for something we've not considered. |
Operations on |
I mean, sure, but I don't see any use cases right now where it would need to be constant time. In any case, since this might just be YAGNI, I would be OK with removing it assuming we don't break anyone. |
One use case: some app doesn't implement itself any group, and uses this package, but reimplements hash-to-scalar. The app doesn't have all the parameters of the group it handles, only abstractions, so it's useful for that app to get the order from the interface. |
What is your preference on how to proceed @armfazh ? |
I have updated this PR to remove the |
There is no point in returning a
Scalar
for Order method.Also, returning a big.Int is not desirable.
Since the group order is public and well-know for the groups supported, then it's better to remove the method.
Based on top of: #355 (merge that first)
Fixes #214