-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core Add] Add support to Ed25519 #3507
base: HF_Echidna
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ut for false verification?
/// <param name="publicKey">The public key to be used.</param> | ||
/// <returns><see langword="true"/> if the signature is valid; otherwise, <see langword="false"/>.</returns> | ||
[ContractMethod(Hardfork.HF_Echidna, CpuFee = 1 << 15)] | ||
public static bool VerifyWithEd25519(byte[] message, byte[] signature, byte[] publicKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Message, pubkey, signature? As in VerifyWithEcdsa
sure |
… add fails ut and cryptolib ut.
# Conflicts: # src/Neo/Cryptography/Ed25519.cs # src/Neo/SmartContract/Native/CryptoLib.cs # tests/Neo.UnitTests/Cryptography/UT_Ed25519.cs
verifier.BlockUpdate(message, 0, message.Length); | ||
return verifier.VerifySignature(signature); | ||
} | ||
catch (Exception) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I was talking only about ArgumentException, e.g. only about input data of invalid length and some other ArgumentException thrown by this part of code. However, catching any exception is a valid solution as far.
@roman-khimov, what do you think about cases when we should return true/false or FAULT VM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be both ways, but we need to know all of the exceptions that can happen in this block. Some are likely OK to be converted to false
result (invalid signature), some may not (verifier
constructor failure?). I'd expect some symmetry to ECDSA verification function. Like what happens if the key is wrong?
…eo-project#3449) * Part-1 `Neo.IO` - move * Part-2 * Added `BigInteger` to `Neo.Extensions` * Found more `BigInteger` * Added `ByteArray` to `Neo.Extensions` * Added `DateTime` Extensions to `Neo.Extensions` * Added `HashSetExtensions`, `HashSetExtensions2`, `IpAddressExtensions`, `AssemblyExtensions`, `StringExtensdions` Deleted `Helper.cs` file * Added `ICollection`, `Memory`, `String`, `Unsafe` extensions * Adding `using` * dotnet format * Added more Extensions * Move some methods * Added Tests * Added `tests` from `Part-2` * Added `tests` for `PART-4` * Added `tests` for `PART-5` * Added the `Part` 7 * `PART-8` * `PART-9` * `PART-10` * Revert some changes --------- Co-authored-by: Shargon <shargon@gmail.com>
* [Add] Get Accounts and Balances for GasToken * Removed `BalanceOf` extension * Added null check * Changed `Seek` to `Find` for `DataCache` --------- Co-authored-by: Jimmy <jinghui@wayne.edu>
# Conflicts: # src/Neo/Neo.csproj
Description
This pr adds support to Ed25519 as is suggested in #3506
Tested with test vectors from RFC 8032 (https://datatracker.ietf.org/doc/html/rfc8032)
Fixes # #3506
Type of change
How Has This Been Tested?
Test Configuration:
Checklist: