Re: modInverse & powMod

2025-01-17 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 8 June 2024 at 12:28:43 UTC, Salih Dincer wrote: Is PR required? Why not modInverse too! The [std.bigint](https://github.com/dlang/phobos/blob/v2.109.1/std/bigint.d) module was prepared very harmoniously with its backend, but it seems to have been removed to the dusty pages of hi

Re: modInverse & powMod

2025-01-10 Thread Salih Dincer via Digitalmars-d-learn
On Saturday, 8 June 2024 at 12:28:43 UTC, Salih Dincer wrote: Is PR required? Why not modInverse too! ```d long extendedEuclidean(long a, long b) { long old_r = a, r = b; long old_s = 1, s = 0; long old_t = 0, t = 1; while (r != 0) { long quotient = old_r / r; l

Re: modInverse & powMod

2024-06-08 Thread Salih Dincer via Digitalmars-d-learn
On Friday, 7 June 2024 at 13:43:29 UTC, Salih Dincer wrote: SDB@79 I have only one question: Is there a modInverse() function in the standard library for use in RSA? Apparently not, it fell to lot :) I already had such a function... ```d auto modInverse(T)(T m, T n) pure { T q, ilk = n;