[SECP256K1] Add safegcd based modular inverse modules
Summary:
Comes with full documentation and tests.
Partial backport of secp256k1#831:
https://github.com/bitcoin-core/secp256k1/pull/831/commits/8e415acba25830da9c23a4dd5531ebfc6b65aae7
https://github.com/bitcoin-core/secp256k1/pull/831/commits/d8a92fcc4c65cf189ec7bd5298dad8479347c442
https://github.com/bitcoin-core/secp256k1/pull/831/commits/151aac00d31ba5e94800376f6fda4193071168af
Depends on D9401.
Test Plan:
ninja check-secp256k1
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D9402