• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

neo-project / neo / 9026436724

10 May 2024 02:36AM UTC coverage: 76.092% (+0.2%) from 75.867%
9026436724

push

github

web-flow
Support Koblitz-based and Keccak256-based custom witness verification (#3209)

* Native: extend CryptoLib's verifyWithECDsa with hasher parameter

A port of
https://github.com/nspcc-dev/neo-go/pull/3425/commits/1e2b438b5.

This commit contains minor protocol extension needed for custom
Koblitz-based verification scripts (an alternative to
https://github.com/neo-project/neo/pull/3205).

Replace native CryptoLib's verifyWithECDsa `curve` parameter by
`curveHash` parameter which is a enum over supported pairs of named
curves and hash functions. NamedCurve enum mark as deprecated and
replaced by NamedCurveHash with compatible behaviour.

Even though this change is a compatible extension of the protocol, it
changes the genesis state due to parameter renaming (CryptoLib's
manifest is changed). But we're going to resync chain in 3.7 release
anyway, so it's not a big deal.

Also, we need to check mainnet and testnet compatibility in case if
anyone has ever called verifyWithECDsa with 24 or 25 `curve` value.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>

* SmartContract: add extension to ScriptBuilder for System.Contract.Call

Group the set of common operations required to emit
System.Contract.Call appcall.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>

* Native: add an example of custom Koblitz signature verification

Koblitz-based and Keccak-based transaction witness verification for
single signature and multisignature ported from
https://github.com/nspcc-dev/neo-go/pull/3425.

An alternative to https://github.com/neo-project/neo/pull/3205.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>

* SmartContract: make multisig koblitz easier to parse

1. Make prologue be exactly the same as regular CheckMultisig.
2. But instead of "SYSCALL System.Crypto.CheckMultisig" do INITSLOT and K check.
3. This makes all of the code from INITSLOT below be independent of N/M, so
   one ... (continued)

4302 of 6526 branches covered (65.92%)

Branch coverage included in aggregate %.

54 of 57 new or added lines in 3 files covered. (94.74%)

15584 of 19608 relevant lines covered (79.48%)

171505.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.83
/src/Neo/Cryptography/Helper.cs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc