Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add elliptic curve marker trait? #72

Open
CjS77 opened this issue Jan 5, 2022 · 1 comment
Open

Add elliptic curve marker trait? #72

CjS77 opened this issue Jan 5, 2022 · 1 comment
Labels
C-Good_first_issue Good for newcomers C-tech_debt Paying back tech-debt.

Comments

@CjS77
Copy link
Contributor

CjS77 commented Jan 5, 2022

Consider

impl<P, K> SchnorrSignature<P, K>
where
    P: PublicKey<K = K>,
    K: SecretKey,
{...}

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

@CjS77 CjS77 added C-tech_debt Paying back tech-debt. C-Good_first_issue Good for newcomers and removed chores labels Sep 20, 2022
@AaronFeickert
Copy link
Contributor

One approach could be using traits generalizing cryptographic groups. These are implemented in the Ristretto library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Good_first_issue Good for newcomers C-tech_debt Paying back tech-debt.
Projects
None yet
Development

No branches or pull requests

2 participants