vrfVerify method

  1. @override
bool vrfVerify(
  1. List<int> message,
  2. List<int> vrfSign, {
  3. List<int>? context,
  4. List<int>? extra,
})
override

Implementation

@override
bool vrfVerify(List<int> message, List<int> vrfSign,
    {List<int>? context, List<int>? extra}) {
  if (vrfSign.length != _SubstrateSr25519SignerConst.vrfResultLength) {
    throw ArgumentException(
        "Invalid VrfSign bytes length. excepted: ${_SubstrateSr25519SignerConst.vrfResultLength} got: ${vrfSign.length} ");
  }
  final MerlinTranscript vrfScript =
      _SubstrateSr25519SignerUtils.vrfScript(extra: extra);
  final MerlinTranscript script =
      _SubstrateSr25519SignerUtils.substrateVrfSignScript(message, context);
  final VRFPreOut output =
      VRFPreOut(vrfSign.sublist(0, SchnorrkelKeyCost.vrfPreOutLength));
  final VRFProof proof =
      VRFProof.fromBytes(vrfSign.sublist(SchnorrkelKeyCost.vrfPreOutLength));
  return _verifier.vrfVerify(script, output, proof, verifyScript: vrfScript);
}