Skip to content

trait ValidatedRsaPrivateComponents over struct RsaPrivateKey #640

@pinkforest

Description

@pinkforest

The current RsaPrivateKey is just a validated construct essentially.

Are there any reasons on

a) why it can't be just expressed as a trait benefiting no-alloc impl ? e.g. why do we need hold copies ?

b) why that can't be handed over to end-user e.g. hazmat unchecked or validating PKCS#8 wrapper ?

Given no-alloc will require memory efficient representation for it

type PKCS8Rsa impl VerifiedRsaPrivateKey
  type [..]: Unsigned // Can be optimised across exp & modulus over largest variant of say just one generic `U`
  ..

Pros:

  • hazmat End-users can provide unchecked / checked construct as-is without specialised API surface
  • Generalize impls around that in no-alloc and alloc
  • Could provide conditional for Multi Prime (MP-RSA)
  • Could provide conditional for precomputed
  • Optimised memory pressure given usage-scenario/s
  • Direct PKCS#8 (or other containers) borrowed layout into validated type
  • Associated types can be optimized for it's intended use in algorithms

Cons:

  • Complexity ?
  • Harder ?
  • .. ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions