GaloisInc / RSA

Haskell RSA Library
Other
20 stars 7 forks source link

crypto-pubkey-types rsa updates #4

Closed vincenthz closed 12 years ago

vincenthz commented 12 years ago

Hi, i'm planning to update the private key RSA structure with the following patch:

    -    { private_size :: Int     -- ^ size of key in bytes
    -    , private_n    :: Integer -- ^ private p*q
    +    { private_pub  :: PublicKey -- ^ public part of a private key (size, n and e)

This makes the public key a sub field of a private key, instead of having 2 duplicate fields (private_n and private_size). In this case, e is useful for doing crypto-blinding when using chinese remainder optimisations.

is this update acceptable for RSA ? if so i'll do a pull request, otherwise i'm willing to discuss other possible solutions.

acw commented 12 years ago

Are these the only two reasons to combine the structures? It seems a bit confusing to me for some reason. I'd almost rather duplicate e as well, if that's what you're really looking for.

vincenthz commented 12 years ago

yes, i agree it's not necessarily ideal, and i'm not totally sure how to handle it the best way. However practically it seems to make sense:

acw commented 12 years ago

OK, you've convinced me. Send me a pull request and I'll pull it in.