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

Implement core::ops::Shr for BigInt in place of BigInt::divn() #714

Closed
mmaker opened this issue Dec 14, 2023 · 3 comments · Fixed by #736
Closed

Implement core::ops::Shr for BigInt in place of BigInt::divn() #714

mmaker opened this issue Dec 14, 2023 · 3 comments · Fixed by #736
Labels
D-easy Difficulty: easy

Comments

@mmaker
Copy link
Member

mmaker commented Dec 14, 2023

https://github.com/arkworks-rs/algebra/blob/master/ff/src/biginteger/mod.rs#L434
The BigInt::divn function should instead be done with overloading using the trait Shr from the standard library.
(Cf. #713)

@mmaker mmaker added the D-easy Difficulty: easy label Dec 14, 2023
@mmaker mmaker changed the title Implement Shr for BigInt in place of BigInt::divn() Implement core::ops::Shr for BigInt in place of BigInt::divn() Dec 14, 2023
@mmaker
Copy link
Member Author

mmaker commented Dec 14, 2023

@hdvanegasm want to give it a shot? :)

@hdvanegasm
Copy link
Contributor

hdvanegasm commented Dec 19, 2023

It would be nice to implement not only core::ops::Shr but also core::ops::Shl. If I implement core::ops::Shl for BigInt<N> by moving it some bits and there is an overflow of M limbs, should I return a BigInt<N + M> or should I just return a BigInt<N> and chop the overflow?

@mmaker
Copy link
Member Author

mmaker commented Dec 19, 2023

This issue is just for Shr :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-easy Difficulty: easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants