aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Oops. Secret nonce/seed for blinding for DH and ElGamal was 2^x mod p.lloyd2010-03-092-2/+2
| | | | | | | | | However if the group generator is 2, that's precisely the public key, which is hardly secret at all. Instead use y^x mod p, which while a little dubious in terms of mathematical structure is probably OK after being hashed through SHA-512 with some high resolution timestamps.
* De-name unused rng arglloyd2010-03-091-1/+1
|
* Deconstify PK_Ops. It's quite reasonable that some op will want tolloyd2010-03-0925-148/+114
| | | | | | | | | | | | | precompute only as needed, or will want to access some other expensive resource or etc. Change how the secret for generating blinding is done in cases where a PRNG isn't available. Use the operations public op to hide the secret, for instance the seed for a DH blinding variable is 2^x mod p. Make use of being able to mutate internal structures in the RW signer, since that does have access to a PRNG, so use it to initialize the blinder on first call to sign().
* Dont need RNG in this testlloyd2010-03-091-3/+2
|
* Consolidate code for choosing a window size for fixed width windowlloyd2010-03-094-72/+41
| | | | exponentiation algorithms.
* Add back RSA consistency checking (decrypt only)lloyd2010-03-092-3/+8
|
* Have PK_Signer check the validity of all signatures before releasing.lloyd2010-03-092-8/+52
| | | | Should help against many forms of fault attacks.
* Use preexisting powermod precomputations for setting up blinderslloyd2010-03-092-2/+2
|
* Remove decls of unimplemented functionslloyd2010-03-081-3/+0
|
* Blinder::choose_nonce added a single byte of the timestamps 8 times,lloyd2010-03-081-2/+2
| | | | instead of each byte once...
* Add back in blinding to RSA, RW, ElGamal, and DH.lloyd2010-03-0815-103/+175
| | | | | | | | | | | | | | | | There are multiple unsatisfactory elements to the current solution, as compared to how blinding was previously done: Firstly, blinding is only used in the baseline implementations; the code using OpenSSL and GMP is not protected by blinding at all. Secondly, at the point we need to set up blinding, there is no access to a PRNG. Currently I am going with a quite nasty solution, of using a private key parameter to seed a simple PRNG constructed as: SHA-512(TS1 || private_key_param || public_key_param || TS2) I really want to fix both of these elements but I'm not sure how to do so easily.
* Rename PK_Encryptor_MR_with_EME and PK_Decryptor_MR_with_EME tolloyd2010-03-0810-55/+57
| | | | | PK_Encryptor_EME and PK_Decryptor_EME; the message recovery is somewhat implicit in the recovery of the plaintext.
* Modify pubkey classes to take names instead of object pointers.lloyd2010-03-0833-329/+313
| | | | | Remove use of look_pk from the source and examples, instead instantiate classes directly.
* Have the constructors in pubkey.h take all arguments look_pk does, andlloyd2010-03-083-39/+51
| | | | convert look_pk to simple forwarders.
* Update DH example for PK changeslloyd2010-03-081-14/+29
|
* Remove the now no-op classes PK_Encrypting_Key,lloyd2010-03-0819-148/+38
| | | | | PK_Decrypting_Key, PK_Signing_Key, PK_Verifying_with_MR_Key, and PK_Verifying_wo_MR_Key.
* On GMP 5.0 and later, use mpz_powm_sec, which is a version of modularlloyd2010-03-051-0/+6
| | | | exponentiation that has countermeasures against side-channel attacks.
* Update OpenSSL engine for new interface. Similiar to GMP engine, droplloyd2010-03-059-503/+356
| | | | support for ElGamal and NR, leaving only RSA, DSA, and DH support.
* Add GMP PK filelloyd2010-03-051-0/+344
|
* Clarify that Ajisai is only SSLv3 + TLS 1.0 currentlylloyd2010-03-051-1/+1
|
* Remove unused variablelloyd2010-03-051-1/+0
|
* Update GMP engine with new PK operations interface.lloyd2010-03-058-481/+11
| | | | | Drop support for ElGamal and NR from GMP engine, leaving just DH, DSA, and RSA
* Set domain_encoding enum in all EC key constructorslloyd2010-03-051-10/+15
|
* Inline Engine_Core::mod_exp into singler caller, and deletelloyd2010-03-054-74/+19
|
* Remove IF_Corelloyd2010-03-0516-366/+7
|
* Add RSA encrypt/decrypt opslloyd2010-03-053-27/+66
|
* Add ops for ElGamal encryption and decryption.lloyd2010-03-0515-399/+208
| | | | | Note: blinding is not currently being used for RSA, RW, DH or ElGamal, which used to have them. This should be added back before release.
* Constify sign and verify opslloyd2010-03-0513-41/+50
|
* Remove sign and verify ops from key typeslloyd2010-03-056-109/+0
|
* Remove ECDSA_PublicKey::verifylloyd2010-03-052-40/+0
|
* Rename PK_Ops::Signature_Operation to PK_Ops::Signaturelloyd2010-03-0513-20/+20
| | | | Rename PK_Ops::KA_Operation to PK_Ops::Key_Agreement
* Remove NR and DSA specific hookslloyd2010-03-0518-626/+5
|
* Add verification ops for all signature key typeslloyd2010-03-0519-146/+409
|
* Make the modulus visible in Modular_Reducerlloyd2010-03-051-0/+2
|
* Inline look_pk funcslloyd2010-03-053-102/+49
|
* Remove the sign() operation from the public key objects, totally replacedlloyd2010-03-0517-358/+153
| | | | | | by using the ops. Add real ECDSA test vectors (two found in ANSI X9.62)
* Force high bit in random_prime as well (done by randomize currently, but ↵lloyd2010-03-051-0/+3
| | | | might not be later)
* Clarify exception text on get_affine when point is zerolloyd2010-03-051-2/+2
|
* Add -Werror to gcc maintainer flagslloyd2010-03-051-1/+1
|
* Add signature generation operation classes. Remove sign() fromlloyd2010-03-0520-72/+474
| | | | | | PK_Signing_Key, though for the moment the class remains because there are a few pieces of code that use it to detect if signatures are supported, or for passing to functions in look_pk
* The operation can assume the key will continue to exist as long as it does,lloyd2010-03-042-7/+6
| | | | so keep the curve and cofactor in ECDH op by reference instead of value.
* Remove some unnecessary usages of PK_Signing_Keylloyd2010-03-043-54/+30
|
* Nix PK_Signing_Key use from tutoriallloyd2010-03-041-3/+1
|
* Client_Key_Exchange needs modification for DH changeslloyd2010-03-041-14/+14
|
* This checkin represents a pretty major change in how PK operations arelloyd2010-03-0424-420/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | performed. Up until now, each key object (eg DSA_PublicKey or ECDH_PrivateKey) had two jobs: contain the key material, and know how to perform any operations on that key. However because of a desire to support alternative implementations (GNU MP, hardware, whatever), there was a notion of operations, with the key objects containing an op that they got via engine rather than actually implementing the underlying algorithms directly. Now, represent the operation as an abstract interface (typically mapping a byte string to a byte string), and pass a plain Public_Key& or Private_Key& to the engine. The engine does any checks it wants (eg based on name, typeid, key sizes, etc), and either returns nothing (I'll pass) or a pointer to a new operation that represents signatures or encryption or what-have-you using that key. This means that plain key objects no longer contain operations. This is a major break with the traditional interface. On the other hand, using these 'bare' operations without padding, KDFs, etc is 99% of the time a bad idea anyway (and if you really need them, there are options so you get the bare op but via the pubkey.h interfaces). Currently this change is only implemented for DH and ECDH (ie, key agreement algorithms). Additionally the optional engines (gnump and openssl) have not been updated. I'll probably wait to touch those until after I can change them all in one go for all algos.
* Use KDF2/PK_Key_Agreement in DH benchmarklloyd2010-03-041-5/+5
|
* Clean up PK_Key_Agreement slightlylloyd2010-03-042-21/+32
|
* Fix typoslloyd2010-03-041-2/+2
|
* Inline simple DSA funcslloyd2010-03-042-21/+6
|
* Remove ElGamal load hook functionslloyd2010-03-042-47/+23
|