[avalanche] implement buildRemoteSighash and buildLocalSighash
Summary: buildLocalSighash is extracted from sendHello and buildRemoteSighash will be used in D9327 to check the AVAHELLO message sent by a peer.
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D9329