HomePhabricator

[SECP256K1] Improve bounds checks in modinv modules

Description

[SECP256K1] Improve bounds checks in modinv modules

Summary:

This commit adds functions to verify and compare numbers in
signed{30,62} notation, and uses that to do more extensive bounds
checking on various variables in the modinv code.

Partial backport of secp256k1#831:
https://github.com/bitcoin-core/secp256k1/pull/831/commits/08d54964e51f318ef0cc4ef09d64cfa5ec143c5c

Depends on D9402.

Test Plan:

ninja check-secp256k1

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D9403

Details

Provenance
Pieter Wuille <pieter@wuille.net>Authored on Dec 23 2020, 19:13
FabienCommitted on Apr 14 2021, 06:49
FabienPushed on Apr 14 2021, 06:49
Reviewer
Restricted Project
Differential Revision
D9403: [SECP256K1] Improve bounds checks in modinv modules
Parents
rABC24b590d38544: [SECP256K1] Add safegcd based modular inverse modules
Branches
Unknown
Tags
Unknown