You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 29, 2021. It is now read-only.
buildPrivateKeyFromPoint/unsafeBuildPrivateKeyFromPoint delegate to java.security.spec.ECPrivateKeySpec, and the parameter passed is "the private value S". This is a secret value, not a point, so the method are misnamed.
unsafeBuildPublicKeyFromPoints delegates to java.security.spec.ECPublicKeySpec, and the parameters passed in are the affine x-coordinate and affine y-coordinate of the public point of the curve. Since we are passing in the coordinates of a single point, not multiple points, this method is also misnamed.
One more thing to note: there is a lack of symmetry between buildPublicKey and unsafeBuildPublicKeyFromPoints, since in most other cases, unsafe is appended to another method name without any other changes.
The text was updated successfully, but these errors were encountered:
Also, to be honest, tsec 0.1 should really revamp these to just return Option.
Majority of these unsafeBlah is just laziness on my part when I wrote them months ago. There's no real observable side effect from doing this, despite forcing a try/catch
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Some comments on methods in ECKFTag:
buildPrivateKeyFromPoint
/unsafeBuildPrivateKeyFromPoint
delegate tojava.security.spec.ECPrivateKeySpec
, and the parameter passed is "the private value S". This is a secret value, not a point, so the method are misnamed.unsafeBuildPublicKeyFromPoints
delegates tojava.security.spec.ECPublicKeySpec
, and the parameters passed in are the affine x-coordinate and affine y-coordinate of the public point of the curve. Since we are passing in the coordinates of a single point, not multiple points, this method is also misnamed.One more thing to note: there is a lack of symmetry between
buildPublicKey
andunsafeBuildPublicKeyFromPoints
, since in most other cases,unsafe
is appended to another method name without any other changes.The text was updated successfully, but these errors were encountered: