maybe add `assert(carry == 0);` to catch a bug that causes an overflow
(same in EncodeBase58)