API Gap: KeyPairGenerator

Aperta
#147 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Start by reading traits.rs and the existing SignaturePublicKey, SignaturePrivateKey, KEMPublicKey, KEMPrivateKey, RNG, SignatureError, and KEMError definitions. Compare the proposed key-generation traits with the current API and decide whether KEM should remain distinct from broader encryption or agreement terminology. Done means the trait scope and naming are agreed and the relevant key types can use the resulting API.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

There's currently nothing in traits.rs for this.

My learned machine colleague suggests a natural fit for the public/private key classes would be:

pub trait SignatureKeyPairGenerator<
    PK: SignaturePublicKey<PK_LEN>,
    SK: SignaturePrivateKey<SK_LEN>,
    const PK_LEN: usize,
    const SK_LEN: usize,
>
{
    /// Generates a key pair using the library's default OS-backed RNG.
    fn keygen() -> Result<(PK, SK), SignatureError>;

    /// Generates a key pair using the provided RNG.
    fn keygen_from_rng(rng: &mut dyn RNG) -> Result<(PK, SK), SignatureError>;
}

and

pub trait KEMKeyPairGenerator<
    PK: KEMPublicKey<PK_LEN>,
    SK: KEMPrivateKey<SK_LEN>,
    const PK_LEN: usize,
    const SK_LEN: usize,
>
{
    /// Generates a key pair using the library's default OS-backed RNG.
    fn keygen() -> Result<(PK, SK), KEMError>;

    /// Generates a key pair using the provided RNG.
    fn keygen_from_rng(rng: &mut dyn RNG) -> Result<(PK, SK), KEMError>;
}

These could then be combined with the appropriate types to simplify the notation for invoking one.

It's possible that KEMKeyPairGenerator might be better as EncryptionKeyPairGenerator in-case RSA/OAEP get's added at a later date, XDH might be another candidate for "Encryption" although again, it and Diffie-Hellman might deserve "Agreement".

Lingua principale
Rust
Stelle
25
Fork
18
Merge medio
16h 38m
PR unite (30g)
3

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di bcgit/bc-rust

Tutte le issue di bcgit/bc-rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.