Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,11 @@
// Calculate the inverse of a (mod m)
// See here for eea specs:
// https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm
let modInv m a =
let rec eea t t' r r' =
match r' with
| 0 -> t
| _ ->
let div = r/r'
eea t' (t - div * t') r' (r - div * r')
(m + eea 0 1 m a) % m