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

Remove unproven shortcut from safeScalarMultiply #16

Merged
merged 2 commits into from
Jan 16, 2018
Merged

Conversation

jml
Copy link
Collaborator

@jml jml commented Jan 14, 2018

Makes ensureInGroup behaviour conform better to Python implementation.

@ocheron care to take a look?

@ocheron
Copy link
Contributor

ocheron commented Jan 14, 2018

Yes that should be enough to fix the issue with ensureInGroup.

However I'm wondering about any performance impact. If I understand correctly the derivation of scalar from password, we have 16 additional bytes here. So the scalar multiplication has to process 128 more bits.

It might be interesting to move the reduction modulo L to a place where the element is known to be in the subgroup:

scalarMultiply _ n x = safeScalarMultiply n x

@jml
Copy link
Collaborator Author

jml commented Jan 16, 2018

Thanks! Suggested optimization legit, but not something I have time to process right now—alas.

@jml jml merged commit 5d79f72 into master Jan 16, 2018
@jml jml deleted the ensure-in-group branch January 16, 2018 10:55
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.

2 participants