-
Notifications
You must be signed in to change notification settings - Fork 42
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
Initialising with ByteArray differs from java's BigInteger #153
Comments
@fullkomnun You might be interested to look into https://github.com/ionspin/kotlin-multiplatform-libsodium and https://github.com/ionspin/kotlin-multiplatform-crypto for crypto multiplatform needs. They are not remotely ready for production use at the moment, but you might point out what you need in this early development stage of these two libraries. |
Thanks, will take a look. |
@fullkomnun Just be aware that Kotlin Native (and bignum itself) can be very slow, you might want to use expect/actual mechanism of Kotlin Multiplatform and then use native library when necessarily. Kotlin native should get faster as it matures though, and bignum has a native version tentatively planned in the future. |
The main targets for now are JVM and nodeJS. |
I'm waiting for the build to finish for the latest merge and then I'll get to publishing a new release, all in all should be available by the end of the day if Maven Central nexus repo doesn't give me trouble like last time. |
Describe the bug
For a specific overflow byte array, initialising creates a different value comapred to java's BigInteger.
To Reproduce
Steps to reproduce the behavior:
sample unit test:
Expected behavior
Expected same numeric value as with java's BigInteger but it differs and this test fails.
Platform
JVM
Additional context
Although i encountered this issue for these specific values, there obviously could be more and randomised testing can help here.
The text was updated successfully, but these errors were encountered: