signBip340Const method

List<int> signBip340Const({
  1. required List<int> digest,
  2. List<int>? tapTweakHash,
  3. List<int>? aux,
})

Implementation

List<int> signBip340Const(
    {required List<int> digest, List<int>? tapTweakHash, List<int>? aux}) {
  final signature = _signingKey.signBip340Const(
      digest: digest, aux: aux, tapTweakHash: tapTweakHash);
  if (verifierKey.verifyBip340Signature(
      digest: digest, signature: signature, tapTweakHash: tapTweakHash)) {
    return signature;
  }
  throw const CryptoSignException(
      'The created signature does not pass verification.');
}