Open fiadliel opened 6 years ago
You're right and naming is hard.
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
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.