sign method

Signature sign(
  1. Uint8List message, {
  2. HmacFnSync? hmacFnSync,
  3. RandomBytesFunc? randomBytesFunc,
  4. bool? lowS,
  5. Uint8List? extraEntropy,
})

Implementation

Signature sign(Uint8List message,
    {HmacFnSync? hmacFnSync,
    RandomBytesFunc? randomBytesFunc,
    bool? lowS,
    Uint8List? extraEntropy}) {
  hmacFnSync ??= (key, msgs) => hmacSha256(key, Utilities.concatBytes(msgs));
  final (seed, k2sig) = Utilities.prepSig(message, _privateKey,
      randomBytesFunc: randomBytesFunc,
      lowS: lowS,
      extraEntropy: extraEntropy); // Extract arguments for hmac-drbg
  return Utilities.hmacDrbg(hmacFnSync)(
      seed, k2sig); // Re-run drbg until k2sig returns ok
}