aboutsummaryrefslogtreecommitdiffstats
path: root/docs/hazmat
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2014-03-15 15:15:30 -0700
committerAlex Gaynor <alex.gaynor@gmail.com>2014-03-15 15:15:30 -0700
commit106cc54b4344cc97af54eccb4d873434efe4203a (patch)
treef1253ea7cbd411c5f97e25558defc5de6eb95cd1 /docs/hazmat
parent7b9d92416ece98fdb12b2c220b81d5180bc87945 (diff)
parenta0fdedef7328615fad7f174d52d6dc36346c7e2f (diff)
downloadcryptography-106cc54b4344cc97af54eccb4d873434efe4203a.tar.gz
cryptography-106cc54b4344cc97af54eccb4d873434efe4203a.tar.bz2
cryptography-106cc54b4344cc97af54eccb4d873434efe4203a.zip
Merge pull request #775 from reaperhulk/rsa-mgf1-class
add MGF1 class, docs, tests
Diffstat (limited to 'docs/hazmat')
-rw-r--r--docs/hazmat/primitives/asymmetric/padding.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/hazmat/primitives/asymmetric/padding.rst b/docs/hazmat/primitives/asymmetric/padding.rst
index 7aec3bd3..8a034329 100644
--- a/docs/hazmat/primitives/asymmetric/padding.rst
+++ b/docs/hazmat/primitives/asymmetric/padding.rst
@@ -17,4 +17,27 @@ Padding
PKCS1 v1.5 (also known as simply PKCS1) is a simple padding scheme
developed for use with RSA keys. It is defined in :rfc:`3447`.
+Mask Generation Functions
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. class:: MGF1(algorithm, salt_length)
+
+ .. versionadded:: 0.3
+
+ MGF1 (Mask Generation Function 1) is used as the mask generation function
+ in :class:`PSS` padding. It takes a hash algorithm and a salt length.
+
+ :param algorithm: An instance of a
+ :class:`~cryptography.hazmat.primitives.interfaces.HashAlgorithm`
+ provider.
+
+ :param int salt_length: The length of the salt. It is recommended that this
+ be set to ``MGF1.MAX_LENGTH``.
+
+ .. attribute:: MAX_LENGTH
+
+ Pass this attribute to ``salt_length`` to get the maximum salt length
+ available.
+
+
.. _`Padding is critical`: http://rdist.root.org/2009/10/06/why-rsa-encryption-padding-is-critical/