tomSecretsChallengeInput function
The MAC input: label's ASCII, both nonces, serviceStart as 8 bytes
big-endian.
Implementation
Uint8List tomSecretsChallengeInput(
String label,
List<int> serviceNonce,
List<int> adminNonce,
int serviceStart,
) {
if (serviceNonce.length != tomSecretsKeyBytes ||
adminNonce.length != tomSecretsKeyBytes) {
throw ArgumentError('a nonce is $tomSecretsKeyBytes bytes');
}
final start = ByteData(8)..setUint64(0, serviceStart);
return Uint8List.fromList([
...ascii.encode(label),
...serviceNonce,
...adminNonce,
...start.buffer.asUint8List(),
]);
}