From 836b830b155c1b04fbad40ab76f0de4339d8628c Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 18 Jan 2015 09:42:58 -0600 Subject: recover (p, q) given (n, e, d). fixes #975 --- docs/hazmat/primitives/asymmetric/rsa.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'docs') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index fa72cced..7a22c204 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -391,6 +391,21 @@ this without having to do the math themselves. Computes the ``dmq1`` parameter from the RSA private exponent and prime ``q``. +.. function:: rsa_recover_prime_factors(n, e, d) + + .. versionadded:: 0.8 + + .. note:: + + When recovering prime factors this algorithm will always return ``p`` + and ``q`` such that ``p < q``. + + + Computes ``(p, q)`` given the modulus, public exponent, and private + exponent. + + :return: A tuple ``(p, q)`` + .. _`RSA`: https://en.wikipedia.org/wiki/RSA_(cryptosystem) .. _`public-key`: https://en.wikipedia.org/wiki/Public-key_cryptography -- cgit v1.2.3 From aca05e6c7d7efff451c3f149d0e9e12d34a63a9f Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 18 Jan 2015 10:02:53 -0600 Subject: various improvements to rsa_recover_prime_factors per review feedback --- docs/hazmat/primitives/asymmetric/rsa.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'docs') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 7a22c204..4423aa8e 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -395,15 +395,14 @@ this without having to do the math themselves. .. versionadded:: 0.8 + Computes ``(p, q)`` given the modulus, public exponent, and private + exponent. + .. note:: When recovering prime factors this algorithm will always return ``p`` and ``q`` such that ``p < q``. - - Computes ``(p, q)`` given the modulus, public exponent, and private - exponent. - :return: A tuple ``(p, q)`` -- cgit v1.2.3 From 65637eb7dc466e4b715bddf1188a6d04845167a1 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sun, 18 Jan 2015 15:48:47 -0600 Subject: doc update --- docs/hazmat/primitives/asymmetric/rsa.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/hazmat/primitives/asymmetric/rsa.rst b/docs/hazmat/primitives/asymmetric/rsa.rst index 4423aa8e..3c095a54 100644 --- a/docs/hazmat/primitives/asymmetric/rsa.rst +++ b/docs/hazmat/primitives/asymmetric/rsa.rst @@ -395,8 +395,8 @@ this without having to do the math themselves. .. versionadded:: 0.8 - Computes ``(p, q)`` given the modulus, public exponent, and private - exponent. + Computes the prime factors ``(p, q)`` given the modulus, public exponent, + and private exponent. .. note:: -- cgit v1.2.3