neo icon indicating copy to clipboard operation
neo copied to clipboard

Refactor ECPoint

Open vncoelho opened this issue 5 years ago • 4 comments

ECPoint is used in different parts of the code, however, in principle, in most of its use cases we could direct use pubkey as byte[] itself.

vncoelho avatar May 19 '20 18:05 vncoelho

Maybe now with support to more cryptography standards there will be more use cases https://github.com/neo-project/neo/commit/1af936929093721ec274167829761ddba825c86c

vncoelho avatar May 19 '20 18:05 vncoelho

However, for a more generic use the function public static ECPoint DecodePoint(ReadOnlySpan<byte> encoded, ECCurve curve) should use the This.Curve of the object.

vncoelho avatar May 19 '20 18:05 vncoelho

Agree, this can better encapsulate the parsing process of publickey in functions such as signature verification, which is conducive to supporting more encryption standards.This is consistent with the principle of cohesion

doubiliu avatar May 21 '20 02:05 doubiliu