planetarium / libplanet

Blockchain in C#/.NET for on-chain, decentralized gaming
https://docs.libplanet.io/
GNU Lesser General Public License v2.1
506 stars 141 forks source link

Raise exception when zero byte array applied as a argument on `PrivateKey` generation #2095

Open OnedgeLee opened 2 years ago

OnedgeLee commented 2 years ago

When zero byte array has been applied as a argument byte[] unverifiedKey on Libplanet.Crypto.PrivateKey key generation, unhandled exception raised from ECDomainParameters.ValidatePrivateScalar in Org.BouncyCastle.Crypto.Parameters appears.

System.ArgumentException : Scalar is not in the interval [1, n - 1] (Parameter 'd')

It's not a bug and proper functionality, since zero multiplication on elliptic curve point is ambiguous, but this exception would be better to raised on Libplanet to make sure our intension.

Gyeonghun-Park commented 2 years ago

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.