Function BlockHeader.verify

Verify that the provided signature is a valid signature for pubkey

bool verify (
  in ref const(agora.crypto.ECC.Point) pubkey,
  in ref const(agora.crypto.ECC.Scalar) preimage,
  in ref const(agora.crypto.ECC.Point) sig
) nothrow @safe const;

bool verify (
  in ref const(agora.crypto.ECC.Point) pubkey,
  in ref const(geod24.bitblob.BitBlob!(64L)) preimage,
  in ref const(agora.crypto.ECC.Point) sig
) nothrow @safe const;

static bool verify (
  in ref const(agora.crypto.ECC.Point) pubkey,
  in ref const(geod24.bitblob.BitBlob!(64L)) preimage,
  in ref const(agora.crypto.ECC.Point) sig,
  in ref const(geod24.bitblob.BitBlob!(64L)) challenge
) nothrow @safe;

static bool verify (
  in ref const(agora.crypto.ECC.Point) pubkey,
  in ref const(agora.crypto.ECC.Scalar) preimage,
  in ref const(agora.crypto.ECC.Point) sig,
  in ref const(agora.crypto.ECC.Scalar) challenge
) nothrow @safe;

This function only checks that sig is valid for pubkey. Whether or not pubkey is allowed to sign this block should be checked by the caller.

Parameters

NameDescription
pubkey Public key of the signing node
preimage Pre-image for pubkey for this round
sig The R of the signature to verify (s is preimage)
challenge The hash of the block header to verify

Returns

true if the signature is valid for pubkey.