Commit graph

9 commits

Author SHA1 Message Date
Legrandin
a343e32bc5 Base ElGamal PKS on the new Math module. 2014-12-06 12:04:12 +01:00
Legrandin
1c3c049a4c Clean up Crypto.PublicKey module
This patch does a few things to simplify the public key classes
(RSA, DSA and ElGamal):

* It removes the Crypto.PublicKey.pubkey module. The 3 classes
  do not have an ancestor anymore.
* Methods sign(), verify(), encrypt(), and decrypt() are removed.
* Methods blind() and unblind() are removed.
* Methods can_sign() and can_encrypt() are removed.
* The 3 classes cannot be pickled anymore.
2014-06-16 22:00:03 +02:00
Legrandin
8acf0d7011 Add checks to verify correctness of RSA/DSA/ElGamal keys
When the various components are assembled into an RSA,
DSA or ElGamal key via the construct() method, we must verify
as much as possible if the result is indeed a valid key.
2013-12-22 13:42:37 +01:00
Legrandin
7214ce9929 Removed most 'import *' statements
[dlitz@dlitz.net: Re-ordered commits; so don't import S2V yet]
[dlitz@dlitz.net: Included an additional 'import *' change from the following commit:]
    commit 4ec64d8eaaa4965889eb8e3b801fc77aa84e0a4e
    Author: Legrandin <helderijs@gmail.com>
    Date:   Tue Sep 10 07:28:08 2013 +0200

        Removed last references to ApiUsageError

[dlitz@dlitz.net: Removed unrelated whitespace changes]
2013-10-20 13:30:21 -07:00
Legrandin
8766da37a2 whitespace changes (pre-AEAD)
[dlitz@dlitz.net: Whitespace changes extracted from the author's pull request:]
- [9c13f9c] Rename 'IV' parameter to 'nonce' for AEAD modes.
- [4ec64d8] Removed last references to ApiUsageError
- [ee46922] Removed most 'import *' statements
2013-10-20 13:30:21 -07:00
Legrandin
4ce6b8d7f1 Fixes to make test suite pass for Python 2.1 and Python 3 2012-05-11 22:57:49 +02:00
Legrandin
5b199b0b7b Add negative test for signature verification.
Verify that Elgamal signature works with longs (it was disabled by
mistake).
2012-05-03 19:10:11 +02:00
Legrandin
ffe841f104 Added test vectors for ElGamal signatures. 2012-05-03 00:46:44 +02:00
Legrandin
7834db2809 Added some test vectors for ElGamal (encryption only). Fixed two small bugs in ElGamal code. 2012-04-26 22:42:25 +02:00