diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-06-27 22:29:38 -0400 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2016-06-27 21:29:38 -0500 |
commit | 17097bf9577e4b9ef0989202918a74ebb46fdd69 (patch) | |
tree | 156bea7ac7bbd7ef6e503789180b131714f220f4 /docs/hazmat/primitives | |
parent | fa8ed29a9769ec67193d8f80208c20fecf4d39fc (diff) | |
download | cryptography-17097bf9577e4b9ef0989202918a74ebb46fdd69.tar.gz cryptography-17097bf9577e4b9ef0989202918a74ebb46fdd69.tar.bz2 cryptography-17097bf9577e4b9ef0989202918a74ebb46fdd69.zip |
Fixed #3008 -- expose calculate max pss salt length (#3014)
* Fixed #3008 -- expose calculate max pss salt length
* Fixed a few mistakes in the docs
* move all the code around
* oops
* write a unit test
* versionadded + changelog
Diffstat (limited to 'docs/hazmat/primitives')
-rw-r--r-- | docs/hazmat/primitives/asymmetric/rsa.rst | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 369f857a..93214449 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -330,6 +330,20 @@ Padding :class:`OAEP` should be preferred for encryption and :class:`PSS` should be preferred for signatures. + +.. function:: calculate_max_pss_salt_length(key, hash_algorithm) + + .. versionadded:: 1.5 + + :param key: An RSA public or private key. + :param hash_algorithm: A + :class:`cryptography.hazmat.primitives.hashes.HashAlgorithm`. + :returns int: The computed salt length. + + Computes the length of the salt that :class:`PSS` will use if + :data:`PSS.MAX_LENGTH` is used. + + Mask generation functions ------------------------- @@ -341,11 +355,10 @@ Mask generation functions Removed the deprecated ``salt_length`` parameter. 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. + in :class:`PSS` and :class:`OAEP` padding. It takes a hash algorithm. - :param algorithm: An instance of a - :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm` - provider. + :param algorithm: An instance of + :class:`~cryptography.hazmat.primitives.hashes.HashAlgorithm`. Numbers ~~~~~~~ |