Skip to content

crypto/rsa: reimplement GenerateKey per FIPS 186-5 with bigmod [freeze exception] #69799

Closed
@FiloSottile

Description

@FiloSottile

For #69536, we'll need rsa.GenerateKey to comply with FIPS 140-3 requirements. Moreover, we don't want to include math/big in the module boundary, so we'll need to reimplement it on top of crypto/internal/bigmod.

  • Need to comply with IG C.E, IG C.F, and FIPS 186-5
  • Should use the process in FIPS 186-5 A.1.1, A.1.3, B.3, B.3.2, and B.3.3
    • That is, we should run at least two (see IG C.F) Enhanced Miller-Rabin tests followed by a Lucas test
  • Key generation runs only once, so it's ok for it not to be constant time, if it significantly reduces complexity
  • For it to be testable, the process should draw non-determinism only from the DRBG io.Reader
    • Every reachable condition should have a test vector, unreachable conditions should be marked by a comment
  • GenerateMultiPrimeKey is deprecated and doesn't need to be supported

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixPendingIssues that have a fix which has not yet been reviewed or submitted.NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    Status

    Approved

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions