diff options
author | Legrandin <gooksankoo@hoiptorrow.mailexpire.com> | 2012-04-19 22:40:39 +0200 |
---|---|---|
committer | Legrandin <gooksankoo@hoiptorrow.mailexpire.com> | 2012-04-19 22:40:39 +0200 |
commit | 6f312637208cc70b231892109564e2aebc92728a (patch) | |
tree | 760d66683a87e3a6c4e53498094e351511ec4313 | |
parent | 9f912f13df99ad3421eff360d6a62d7dbec755c2 (diff) | |
download | pycrypto-6f312637208cc70b231892109564e2aebc92728a.tar.gz |
Fix documentation for PKCS#1 modules.
Objects used by PKCS#1 modules were treated as private,
and therefore ignored by epydoc.
Replaced SHA module with None as PBKDF1 default parameter value, because it was
not displayed nicely by epydoc. Default value is assigned in the body.
-rw-r--r-- | lib/Crypto/Cipher/PKCS1_OAEP.py | 2 | ||||
-rw-r--r-- | lib/Crypto/Cipher/PKCS1_v1_5.py | 2 | ||||
-rw-r--r-- | lib/Crypto/Protocol/KDF.py | 7 | ||||
-rw-r--r-- | lib/Crypto/Signature/PKCS1_PSS.py | 2 | ||||
-rw-r--r-- | lib/Crypto/Signature/PKCS1_v1_5.py | 2 |
5 files changed, 9 insertions, 6 deletions
diff --git a/lib/Crypto/Cipher/PKCS1_OAEP.py b/lib/Crypto/Cipher/PKCS1_OAEP.py index f02609d..9afe176 100644 --- a/lib/Crypto/Cipher/PKCS1_OAEP.py +++ b/lib/Crypto/Cipher/PKCS1_OAEP.py @@ -52,7 +52,7 @@ the RSA key: from __future__ import nested_scopes __revision__ = "$Id$" -__all__ = [ 'new' ] +__all__ = [ 'new', 'PKCS1OAEP_Cipher' ] import Crypto.Signature.PKCS1_PSS import Crypto.Hash.SHA diff --git a/lib/Crypto/Cipher/PKCS1_v1_5.py b/lib/Crypto/Cipher/PKCS1_v1_5.py index 3f860ee..c89035d 100644 --- a/lib/Crypto/Cipher/PKCS1_v1_5.py +++ b/lib/Crypto/Cipher/PKCS1_v1_5.py @@ -68,7 +68,7 @@ the RSA key: """ __revision__ = "$Id$" -__all__ = [ 'new' ] +__all__ = [ 'new', 'PKCS115_Cipher' ] from Crypto.Util.number import ceil_div from Crypto.Util.py3compat import * diff --git a/lib/Crypto/Protocol/KDF.py b/lib/Crypto/Protocol/KDF.py index f13a1ca..973b7af 100644 --- a/lib/Crypto/Protocol/KDF.py +++ b/lib/Crypto/Protocol/KDF.py @@ -42,7 +42,7 @@ from Crypto.Util.py3compat import * from Crypto.Hash import SHA as SHA1, HMAC from Crypto.Util.strxor import strxor -def PBKDF1(password, salt, dkLen, count=1000, hashAlgo=SHA1): +def PBKDF1(password, salt, dkLen, count=1000, hashAlgo=None): """Derive one key from a password (or passphrase). This function performs key derivation according an old version of @@ -66,9 +66,12 @@ def PBKDF1(password, salt, dkLen, count=1000, hashAlgo=SHA1): hashAlgo : module The hash algorithm to use, as a module or an object from the `Crypto.Hash` package. The digest length must be no shorter than ``dkLen``. + The default algorithm is `SHA1`. :Return: A byte string of length `dkLen` that can be used as key. -""" + """ + if not hashAlgo: + hashAlgo = SHA1 password = tobytes(password) pHash = hashAlgo.new(password+salt) digest = pHash.digest_size diff --git a/lib/Crypto/Signature/PKCS1_PSS.py b/lib/Crypto/Signature/PKCS1_PSS.py index a89faef..4f50eb8 100644 --- a/lib/Crypto/Signature/PKCS1_PSS.py +++ b/lib/Crypto/Signature/PKCS1_PSS.py @@ -64,7 +64,7 @@ the RSA key: from __future__ import nested_scopes __revision__ = "$Id$" -__all__ = [ 'new' ] +__all__ = [ 'new', 'PSS_SigScheme' ] from Crypto.Util.py3compat import * if sys.version_info[0] == 2 and sys.version_info[1] == 1: diff --git a/lib/Crypto/Signature/PKCS1_v1_5.py b/lib/Crypto/Signature/PKCS1_v1_5.py index 5490687..73ac251 100644 --- a/lib/Crypto/Signature/PKCS1_v1_5.py +++ b/lib/Crypto/Signature/PKCS1_v1_5.py @@ -58,7 +58,7 @@ the RSA key: """ __revision__ = "$Id$" -__all__ = [ 'new' ] +__all__ = [ 'new', 'PKCS115_SigScheme' ] import Crypto.Util.number from Crypto.Util.number import ceil_div |