Changeset View
Changeset View
Standalone View
Standalone View
src/test/schnorr_tests.cpp
Show First 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | valtype DER64{0x30, 0x3e, 0x02, 0x1d, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, | ||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, | 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, | ||||
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, | 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, | ||||
0x44, 0x44, 0x44, 0x44}; | 0x44, 0x44, 0x44, 0x44}; | ||||
// for variety we start off at a different seed than sigencoding_tests | // for variety we start off at a different seed than sigencoding_tests | ||||
// The first lcg.next() call is still 0x00000000 though. | // The first lcg.next() call is still 0x00000000 though. | ||||
MMIXLinearCongruentialGenerator lcg(1234); | MMIXLinearCongruentialGenerator lcg(1234); | ||||
for (int i = 0; i < 4096; i++) { | for (int i = 0; i < 4096; i++) { | ||||
uint32_t flags = lcg.next() | SCRIPT_ENABLE_CHECKDATASIG; | uint32_t flags = lcg.next() | SCRIPT_VERIFY_CHECKDATASIG_SIGOPS; | ||||
const bool hasForkId = (flags & SCRIPT_ENABLE_SIGHASH_FORKID) != 0; | const bool hasForkId = (flags & SCRIPT_ENABLE_SIGHASH_FORKID) != 0; | ||||
const bool hasSchnorr = (flags & SCRIPT_ENABLE_SCHNORR) != 0; | const bool hasSchnorr = (flags & SCRIPT_ENABLE_SCHNORR) != 0; | ||||
const bool hasStricts = | const bool hasStricts = | ||||
(flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | | (flags & (SCRIPT_VERIFY_DERSIG | SCRIPT_VERIFY_LOW_S | | ||||
SCRIPT_VERIFY_STRICTENC)) != 0; | SCRIPT_VERIFY_STRICTENC)) != 0; | ||||
const bool hasNullFail = (flags & SCRIPT_VERIFY_NULLFAIL) != 0; | const bool hasNullFail = (flags & SCRIPT_VERIFY_NULLFAIL) != 0; | ||||
▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines |