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

Alternate implementation #29

Closed

Conversation

brndnmtthws
Copy link
Contributor

I was having a really tough time getting this library to work correctly with another library, and I noticed some differences in the implementation. Specifically, there was a lot of truncation going on (doing mod n everywhere), and the use of BigUint instead of BigInt caused some odd behaviour. This part is particularly confusing.

There's nothing in the spec that says you need to use unsigned integers, or that you need to mod n every operation, so I just removed that, and then everything was okay.

I'm sure there are good reasons for why things were done the way they were, however I'm going to open this PR and leave it here for the benefit of others.

It also includes my 2 other patches from #27 and #28.

This implementation removes the use of unsigned integers (which is not
anywhere in the spec) and a bunch of un-specified mod operations.
@tarcieri
Copy link
Member

tarcieri commented Oct 7, 2020

@brndnmtthws like I said on #27, sorry these PRs haven't been reviewed in a very long time. We're trying to triage some other basic project maintenance, but if you're still interested in discussing these PRs I can take a look after that.

Leandros added a commit to Leandros/PAKEs that referenced this pull request Jan 4, 2022
BREAKING CHANGE: Replaces all BigUInt with BigInt and removes the modulo N
from each operation.

Based on @brndnmtthws changes.
Refs: RustCrypto#27 RustCrypto#28 RustCrypto#29
@tarcieri
Copy link
Member

Continued as #81

@tarcieri tarcieri closed this Jan 22, 2022
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