This is a nice, clean interface imo, but we implicitly assume that the P and K live on an elliptic curve. If we introduce an RSA public-private keypair implementation to this create in the future for example, then we could still impl the PublicKey and PrivaeKey traits, but Schnorr signature should not be allowed.
A simple solution is to create marker trait:
pub trait EllipticCurve {} and implement it for say Ristretto, but not our hypothetical RSA keypair
Consider
This is a nice, clean interface imo, but we implicitly assume that the
P
andK
live on an elliptic curve. If we introduce an RSA public-private keypair implementation to this create in the future for example, then we could still impl thePublicKey
andPrivaeKey
traits, but Schnorr signature should not be allowed.A simple solution is to create marker trait:
pub trait EllipticCurve {}
and implement it for say Ristretto, but not our hypothetical RSA keypair