-
Notifications
You must be signed in to change notification settings - Fork 66
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
Constify all math functions #38
Conversation
Note that for this to be useful yet backward compatible, #36 needs to be merged as well. I'm currently testing this with a cleaner libtomcrypt. It will remain a draft until I'm satisfied that I got it all. |
Also, this warrants updating the version to at least 0.14.0 |
It irritates me that |
e9aa0b8
to
bf88810
Compare
Fixed it, it was much easier than anticipated |
@sjaeckel, would you mind enabling workflows for me? |
Oh, generators! I hadn't noticed those.... Thanks |
I don't quite like the long line output of the generators, gotta admit. But, that's work for another PR |
Is this deemed complete by now? |
723c080
to
8ce1994
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite like the long line output of the generators, gotta admit. But, that's work for another PR
What? You don't like >50k char wide lines?
TBH I don't care since they're auto-generated and I'd leave it like that.
Thanks a lot for this PR!
🤣 |
I saw you fixed all the end-of-line spaces. Cool! |
In my opinion, this can be merged as it currently stands |
I would propose a version bump to 0.13.99 or something like that (implying that "next" is 0.14.0) |
Oh, I just realized ... we're not done here ... :(
|
Oh! Ok, I can fix that tomorrow (it being middle of the night here, it's sleep time) |
Documentation updated |
This covers: - fp_count_bits() - fp_unsigned_bin_size() - fp_to_unsigned_bin() - fp_signed_bin_size() - fp_to_signed_bin() - fp_radix_size() - fp_toradix() - fp_toradix_n() Interestingly, a few of the radix conversion functions were already appropriately consitified.
This covers: - fp_cmp() - fp_cmp_mag() - fp_cmp_d() - fp_add() - fp_add_d() - fp_sub() - fp_sub_d()
This covers: - fp_div_2d() - fp_mod_2d() - fp_mul_2d() - fp_mul_2() - fp_div_2() - fp_cnt_lsb() Technically, these are bit shifting and bit counting functions. Side note: it's a bit curious that they're all implemented in src/bit, except for fp_mul_2d() and fp_mul_2().
This covers: - fp_mul() - fp_div() - fp_mod() - fp_mul_d() - fp_div_d() - fp_mod_d() - fp_sqr()
This covers: - fp_addmod() - fp_submod() - fp_mulmod() - fp_sqrmod() - fp_invmod() - fp_gcd() - fp_lcm() - fp_montgomery_setup() - fp_montgomery_calc_normalization() - fp_montgomery_reduce() - fp_exptmod() - fp_prime_miller_rabin() - fp_isprime() - fp_isprime_ex() This also changes fp_exptmod(), as it changed X temporarily. This turns out to be completely unnecessary.
Signed-off-by: Steffen Jaeckel <[email protected]>
de3212a
to
f050a73
Compare
Anything else I've missed? |
Nope, I've only rebased. |
This is supposed to bring this library to the same standards as other MPI libraries, and most of all, to be able to avoid all the deconstifying casts that currently happen in libtomcrypt when linking with tomsfastmath specifically.