HomePhabricator

Add function to trim leading array zeros maintaining MSB.

Description

Add function to trim leading array zeros maintaining MSB.

Summary:
Add a function MinimalizeBigEndianArray to trim a byte array
of leading zeros, while maintaining any MSB for negation. This
will get used in BIN2NUM in a later patch.

Co-authored-by: Shammah Chancellor <shammah.chancellor@gmail.com>

Test Plan: make check

Reviewers: shadders, movrcx, #bitcoin_abc, schancel, deadalnix

Reviewed By: #bitcoin_abc, schancel

Subscribers: teamcity

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