29 hasher << *zcparams << pk << r << msghash;
46 if (alpha < BN_ZERO || alpha >= q)
return error(
"%s: alpha out of range", __func__);
47 if (beta < BN_ZERO || beta >= q)
return error(
"%s: beta out of range", __func__);
55 hasher << *zcparams << pk << rv << msghash;
58 return error(
"%s: Schnorr signature does not verify", __func__);
CBigNum pow_mod(const CBigNum &e, const CBigNum &m) const
modular exponentiation: this^e mod n
static CBigNum randBignum(const CBigNum &range)
Generates a cryptographically secure random number between zero and range exclusive i....
CBigNum mul_mod(const CBigNum &b, const CBigNum &m) const
modular multiplication: (this * b) mod m
A writer stream (for serialization) that computes a 256-bit hash.
CoinRandomnessSchnorrSignature()
bool Verify(const ZerocoinParams *zcparams, const CBigNum &S, const CBigNum &C, const uint256 msghash) const
Verifies the Schnorr signature on message msghash with public key pk = Cg^-S mod p.
CBigNum groupOrder
The order of the group.
CBigNum h
A second generator for the group.
CBigNum modulus
The modulus for the group.
CBigNum g
A generator for the group.
IntegerGroupParams coinCommitmentGroup
The Quadratic Residue group from which we form a coin as a commitment to a serial number.
#define S(x0, x1, x2, x3, cb, r)
bool IsValidSerial(const ZerocoinParams *params, const CBigNum &bnSerial)
bool error(const char *fmt, const Args &... args)