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

BN.muln with number bigger than 0x4000000 #306

Closed
youPickItUp opened this issue Dec 22, 2023 · 1 comment
Closed

BN.muln with number bigger than 0x4000000 #306

youPickItUp opened this issue Dec 22, 2023 · 1 comment

Comments

@youPickItUp
Copy link
Contributor

youPickItUp commented Dec 22, 2023

BN.muln throws when called with number bigger than 0x4000000

I haven't came across this information until it has blown up on a website 😢

I wanted to make sure it's true and ask for some warning / info in the README / docs.
I can do the PR just let me know if that's correct.

@fanatid
Copy link
Collaborator

fanatid commented Dec 22, 2023

This is expected, internally BN operates 26 bits numbers, so you need to use mul

bn.js/lib/bn.js

Line 1993 in 5df40f8

assert(num < 0x4000000);

Would be nice to have that info in the docs, PRs are welcome!

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

No branches or pull requests

2 participants