From e7d9122f6494ca77ecb61fa17b66d89463a94a73 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Mon, 6 May 2024 16:01:20 +0300 Subject: [PATCH] Native: update NamedCurveHash values for Keccak256 hasher Use 122 and 123 respectively for secp256k1Keccak256 and secp256r1Keccak256. Signed-off-by: Anna Shaleva --- src/Neo/SmartContract/Native/NamedCurveHash.cs | 7 ++----- tests/Neo.UnitTests/SmartContract/Native/UT_CryptoLib.cs | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Neo/SmartContract/Native/NamedCurveHash.cs b/src/Neo/SmartContract/Native/NamedCurveHash.cs index d4dcae6491..8bd63bf874 100644 --- a/src/Neo/SmartContract/Native/NamedCurveHash.cs +++ b/src/Neo/SmartContract/Native/NamedCurveHash.cs @@ -15,9 +15,6 @@ namespace Neo.SmartContract.Native /// Represents a pair of the named curve used in ECDSA and a hash algorithm used to hash message. /// This is a compatible extension of an obsolete enum. /// - /// - /// https://tools.ietf.org/html/rfc4492#section-5.1.1 - /// public enum NamedCurveHash : byte { /// @@ -33,11 +30,11 @@ public enum NamedCurveHash : byte /// /// The secp256k1 curve and Keccak256 hash algorithm. /// - secp256k1Keccak256 = 24, + secp256k1Keccak256 = 122, /// /// The secp256r1 curve, which known as prime256v1 or nistP-256, and Keccak256 hash algorithm. /// - secp256r1Keccak256 = 25 + secp256r1Keccak256 = 123 } } diff --git a/tests/Neo.UnitTests/SmartContract/Native/UT_CryptoLib.cs b/tests/Neo.UnitTests/SmartContract/Native/UT_CryptoLib.cs index 7563cedf1b..81038c9532 100644 --- a/tests/Neo.UnitTests/SmartContract/Native/UT_CryptoLib.cs +++ b/tests/Neo.UnitTests/SmartContract/Native/UT_CryptoLib.cs @@ -533,7 +533,7 @@ public void TestVerifyWithECDsa_CustomTxWitness_SingleSig() // Error: No help topic for 'pos' // NEO-GO-VM 0 > ops // INDEX OPCODE PARAMETER - // 0 PUSHINT8 24 (18) << + // 0 PUSHINT8 122 (7a) << // 2 SWAP // 3 PUSHDATA1 02fd0a8c1ce5ae5570fdd46e7599c16b175bf0ebdfe9c178f1ab848fb16dac74a5 // 38 SYSCALL System.Runtime.GetNetwork (c5fba0e0) @@ -820,7 +820,7 @@ public void TestVerifyWithECDsa_CustomTxWitness_MultiSig() // 193 GE // 194 OR // 195 JMPIF 261 (66/42) - // 197 PUSHINT8 24 (18) + // 197 PUSHINT8 122 (7a) // 199 LDLOC0 // 200 LDLOC3 // 201 PICKITEM