bitsToOctetsWithOrderPadding static method
Converts a sequence of bits represented as a byte array to octets.
Implementation
static List<int> bitsToOctetsWithOrderPadding(List<int> data, BigInt order) {
final BigInt z1 = bitsToBigIntWithLengthLimit(data, order.bitLength);
BigInt z2 = z1 - order;
if (z2 < BigInt.zero) {
z2 = z1;
}
final bytes = bigintToBytesWithPadding(z2, order);
return bytes;
}