Open ghost opened 3 years ago
Tagging subscribers to this area: @tannergooding, @pgovind, @jeffhandley See info in area-owners.md if you want to be subscribed.
Author: | secdev-01 |
---|---|
Assignees: | - |
Labels: | `api-suggestion`, `area-System.Numerics`, `untriaged` |
Milestone: | - |
Adding this to my queue. I won't be able to look at it this month, but I'll consider this in Jan 2021.
This seems reasonable to add to me. I'll let @pgovind do the triage here though 😄
Any updates or momentum on this?
This would be extremely useful. Any update?
This again seems useful as it allows development to stay within the BigInteger Class, rather than rely on external Classes and Methods, or worse, cryptographic applications that are writing their own, untested, error prone Mod Inverse routines.
Background and Motivation
The concept of an multiplicative inverse modulo a base, is perhaps as fundamental as BigInteger.GreatestCommonDivisor. I would propose adding this as a method. This allows development to stay close to BigInteger, rather than have to rely on Cryptographic imports. If this is not selected, perhaps at least an explanation as to why this method was not included?
I mean, if you are including ModPow as a primitive method? Why not ModInverse?
Proposed API
Usage Examples
Alternative Designs
This is just an idea. I think it would make use of the BigInteger class as a primitive stronger. This way we don't have to rely on our custom implementations of calculating an inverse.
Risks
Minimal.
Thank you for your consideration.