Skip to content
Snippets Groups Projects
  • Simon Tatham's avatar
    63b8f537
    New API for primegen(), using PrimeCandidateSource. · 63b8f537
    Simon Tatham authored
    The more features and options I add to PrimeCandidateSource, the more
    cumbersome it will be to replicate each one in a command-line option
    to the ultimate primegen() function. So I'm moving to an API in which
    the client of primegen() constructs a PrimeCandidateSource themself,
    and passes it in to primegen().
    
    Also, changed the API for pcs_new() so that you don't have to pass
    'firstbits' unless you really want to. The net effect is that even
    though we've added flexibility, we've also simplified the call sites
    of primegen() in the simple case: if you want a 1234-bit prime, you
    just need to pass pcs_new(1234) as the argument to primegen, and
    you're done.
    
    The new declaration of primegen() lives in ssh_keygen.h, along with
    all the types it depends on. So I've had to #include that header in a
    few new files.
    63b8f537
    History
    New API for primegen(), using PrimeCandidateSource.
    Simon Tatham authored
    The more features and options I add to PrimeCandidateSource, the more
    cumbersome it will be to replicate each one in a command-line option
    to the ultimate primegen() function. So I'm moving to an API in which
    the client of primegen() constructs a PrimeCandidateSource themself,
    and passes it in to primegen().
    
    Also, changed the API for pcs_new() so that you don't have to pass
    'firstbits' unless you really want to. The net effect is that even
    though we've added flexibility, we've also simplified the call sites
    of primegen() in the simple case: if you want a 1234-bit prime, you
    just need to pass pcs_new(1234) as the argument to primegen, and
    you're done.
    
    The new declaration of primegen() lives in ssh_keygen.h, along with
    all the types it depends on. So I've had to #include that header in a
    few new files.