Skip to content

Commit

Permalink
SmartContract: reduce callflag scope for Koblitz verification scripts
Browse files Browse the repository at this point in the history
All flag is too wide. A port of
nspcc-dev/neo-go@fe292f3.

Ref.
nspcc-dev/neo-go#3425 (comment).

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
  • Loading branch information
AnnaShaleva committed May 6, 2024
1 parent 52d8a83 commit 48d3177
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Neo.UnitTests/SmartContract/Native/UT_CryptoLib.cs
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ public void TestVerifyWithECDsa_CustomTxWitness_SingleSig()

// Continue construction of 'verifyWithECDsa' call.
vrf.Emit(OpCode.PUSH4, OpCode.PACK); // pack arguments for 'verifyWithECDsa' call.
vrf.EmitAppCallNoArgs(CryptoLib.CryptoLib.Hash, "verifyWithECDsa", CallFlags.All); // emit the call to 'verifyWithECDsa' itself.
vrf.EmitAppCallNoArgs(CryptoLib.CryptoLib.Hash, "verifyWithECDsa", CallFlags.None); // emit the call to 'verifyWithECDsa' itself.

// Account is a hash of verification script.
var vrfScript = vrf.ToArray();
Expand Down Expand Up @@ -547,7 +547,7 @@ public void TestVerifyWithECDsa_CustomTxWitness_SingleSig()
// 62 CAT
// 63 PUSH4
// 64 PACK
// 65 PUSH15
// 65 PUSH0
// 66 PUSHDATA1 766572696679576974684543447361 ("verifyWithECDsa")
// 83 PUSHDATA1 1bf575ab1189688413610a35a12886cde0b66c72 ("NNToUmdQBe5n8o53BTzjTFAnSEcpouyy3B", "0x726cb6e0cd8628a1350a611384688911ab75f51b")
// 105 SYSCALL System.Contract.Call (627d5b52)
Expand Down Expand Up @@ -692,7 +692,7 @@ public void TestVerifyWithECDsa_CustomTxWitness_MultiSig()
OpCode.PICKITEM, // pick pub at index pubCnt.
OpCode.LDLOC2, // load msg.
OpCode.PUSH4, OpCode.PACK); // pack 4 arguments for 'verifyWithECDsa' call.
vrf.EmitAppCallNoArgs(CryptoLib.CryptoLib.Hash, "verifyWithECDsa", CallFlags.All); // emit the call to 'verifyWithECDsa' itself.
vrf.EmitAppCallNoArgs(CryptoLib.CryptoLib.Hash, "verifyWithECDsa", CallFlags.None); // emit the call to 'verifyWithECDsa' itself.

// Update loop variables.
vrf.Emit(OpCode.LDLOC3, OpCode.ADD, OpCode.STLOC3, // increment sigCnt if signature is valid.
Expand Down Expand Up @@ -830,7 +830,7 @@ public void TestVerifyWithECDsa_CustomTxWitness_MultiSig()
// 205 LDLOC2
// 206 PUSH4
// 207 PACK
// 208 PUSH15
// 208 PUSH0
// 209 PUSHDATA1 766572696679576974684543447361 ("verifyWithECDsa")
// 226 PUSHDATA1 1bf575ab1189688413610a35a12886cde0b66c72 ("NNToUmdQBe5n8o53BTzjTFAnSEcpouyy3B", "0x726cb6e0cd8628a1350a611384688911ab75f51b")
// 248 SYSCALL System.Contract.Call (627d5b52)
Expand Down

0 comments on commit 48d3177

Please sign in to comment.