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

[Invalid] rem function doesn't compute remainder #198

Closed
kayabaNerve opened this issue Mar 17, 2023 · 4 comments
Closed

[Invalid] rem function doesn't compute remainder #198

kayabaNerve opened this issue Mar 17, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@kayabaNerve
Copy link
Contributor

I updated https://github.com/serai-dex/serai/blob/develop/crypto/dalek-ff-group/src/field.rs to v0.5, replacing the two .reduce calls with rem calls. I now have a test failure where 1 * 1, which should equal 1, is actually 26. It seems to me 0.5's rem is critically broken.

@kayabaNerve kayabaNerve changed the title 0.4 reduce != 0.5 rem rem function doesn't compute remainder Mar 17, 2023
@tarcieri tarcieri added the bug Something isn't working label Mar 17, 2023
@tarcieri
Copy link
Member

That is indeed a serious issue if true.

Would you mind opening a PR with a failing regression test?

@kayabaNerve
Copy link
Contributor Author

Bah. Never mind. I assumed rem was the issue since it was the only change needed for compilation. It's actually that U512::from used to be hi, lo, and now it's lo, hi (#183/final note in #188). Sorry for the misdiagnosis.

@kayabaNerve kayabaNerve changed the title rem function doesn't compute remainder [Invalid] rem function doesn't compute remainder Mar 17, 2023
@tarcieri
Copy link
Member

Aah yeah, sorry, those changes to the tuple ordering are really annoying and should probably be better documented in the CHANGELOG

@kayabaNerve
Copy link
Contributor Author

I am happy it's no longer inconsistent though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants