-
Notifications
You must be signed in to change notification settings - Fork 4
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 rotate functions for ApInts #28
Comments
Well in Rust these methods are called |
I forgot about those functions. I will use those names. |
I am going to postpone finishing this one for a while. |
I implemented a working function. Good news is that I found a way to always avoid allocation, do it in O(n), and support non |
Hey, How is the algorithm comparable with the one used in |
I looked around online for rotate shift functions in bigint libraries and there seems to be none, and I completely forgot about coarser rotate functions. I have a |
Hmm, .. I am currently thinking about the semantic meaning of a rotate function for machine integers. |
It has no numerical meaning but it does have a meaning for the logical bits. The rotate functions are mainly for stuff like hashing and cryptography purposes, which is one of the things the library is targeting as stated in the readme. As far as I know, this library will be the first bigint library ever to support a direct rotation function. I remember now that you based this library initially off some LLVM library that also had an explicit width to its integers, but I can't find the name. Maybe my google-fu is not strong enough. |
Ah okay for crypto-foo it might be an interesting operation! It is based on: https://llvm.org/doxygen/classllvm_1_1APInt.html |
Ok the LLVM library does include rotate functions as |
I think we should stick to the Rust convention here and use |
Oh it is far from trivial I just pushed my work so far to my fork and the commit titled "Implement barrel or circular shifts" has the stuff. My benchmarks show it takes half as much time as the allocation one. |
That sounds super awesome! |
This will be useful to me for making a fuzzer and for cryptography related purposes. What should it be named? Some names I found include:
I will implement it.
The text was updated successfully, but these errors were encountered: