diff options
Diffstat (limited to 'pipermail/pycrypto/2012q2/000588.html')
-rw-r--r-- | pipermail/pycrypto/2012q2/000588.html | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/pipermail/pycrypto/2012q2/000588.html b/pipermail/pycrypto/2012q2/000588.html new file mode 100644 index 0000000..a5fefbf --- /dev/null +++ b/pipermail/pycrypto/2012q2/000588.html @@ -0,0 +1,112 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> + <HEAD> + <TITLE> [pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py + </TITLE> + <LINK REL="Index" HREF="index.html" > + <LINK REL="made" HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20documentation%20for%20PKCS1_PSS.py%20is%20incorrect%2C%0A%20plus%20minor%20issue%20w/%20_slowmath.py&In-Reply-To=%3C010EF8E44879B2468C96768709C743D21CE64770F1%40EXCHANGE.rambus.com%3E"> + <META NAME="robots" CONTENT="index,nofollow"> + <style type="text/css"> + pre { + white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ + } + </style> + <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> + <LINK REL="Previous" HREF="000586.html"> + <LINK REL="Next" HREF="000589.html"> + </HEAD> + <BODY BGCOLOR="#ffffff"> + <H1>[pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py</H1> + <B>Gurney, John-Mark</B> + <A HREF="mailto:pycrypto%40lists.dlitz.net?Subject=Re%3A%20%5Bpycrypto%5D%20documentation%20for%20PKCS1_PSS.py%20is%20incorrect%2C%0A%20plus%20minor%20issue%20w/%20_slowmath.py&In-Reply-To=%3C010EF8E44879B2468C96768709C743D21CE64770F1%40EXCHANGE.rambus.com%3E" + TITLE="[pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py">john-mark at cryptography.com + </A><BR> + <I>Thu May 24 19:36:22 EDT 2012</I> + <P><UL> + <LI>Previous message: <A HREF="000586.html">[pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py +</A></li> + <LI>Next message: <A HREF="000589.html">[pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#588">[ date ]</a> + <a href="thread.html#588">[ thread ]</a> + <a href="subject.html#588">[ subject ]</a> + <a href="author.html#588">[ author ]</a> + </LI> + </UL> + <HR> +<!--beginarticle--> +<PRE>Since that is for compatibility w/ _fastmath, I agree that it shouldn't go there then. + +How about a fix to RSA's construct method that attempts to convert the tuple's contents to longs? + +Such as: +key = self._math.rsa_construct(*(long(x) for x in tup)) + +on line 539. + +Thanks for fixing the doc bug! + +-----Original Message----- +From: Dwayne C. Litzenberger [mailto:<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">dlitz at dlitz.net</A>] +Sent: Thursday, May 24, 2012 3:58 PM +To: Gurney, John-Mark +Cc: <A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">pycrypto at lists.dlitz.net</A> +Subject: Re: [pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py + +On Wed, May 23, 2012 at 10:48:03AM -0700, Gurney, John-Mark wrote: +><i><A HREF="https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Signature/PKCS">https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/Signature/PKCS</A> +</I>><i>1_PSS.py +</I>><i> +</I>><i>In the file on lines 41 & 42 it has: +</I>>>>><i> signer = PKCS1_PSS.new(key) +</I>>>>><i> signature = PKCS1_PSS.sign(key) +</I>><i> +</I>><i>The second line is incorrect. It should be: +</I>>>>><i> signature = signer.sign(h) +</I> +I've committed a fix. Thanks! + +><i>Oh, there is also a bogus assertion in _slowmath.py: +</I>><i><A HREF="https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/PublicKey/_slo">https://github.com/dlitz/pycrypto/blob/master/lib/Crypto/PublicKey/_slo</A> +</I>><i>wmath.py +</I>><i> +</I>><i>On line 85, it asserts that e is long. If you have an e of 3, it is reasonable for e to be a normal int, and not a long. Maybe the asserts should be changed to: +</I>><i>n = long(n) +</I>><i>e = long(e) +</I>><i> +</I>><i>So that python will convert the types properly. +</I> +No, those assertions in _slowmath are there so that we catch usage that would break when using _fastmath. + +_fastmath.rsa_construct (which is written in C) requires long parameters in order to keep the C code simple. If we do the implicit conversions in _slowmath, we should also have do the conversions in _fastmath. Since _fastmath is an internal module, I see no reason for the added complexity (and risk of bugs). + +Cheers, +- Dwayne + +-- +Dwayne C. Litzenberger <<A HREF="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">dlitz at dlitz.net</A>> + OpenPGP: 19E1 1FE8 B3CF F273 ED17 4A24 928C EC13 39C2 5CF7 +</PRE> + + +<!--endarticle--> + <HR> + <P><UL> + <!--threads--> + <LI>Previous message: <A HREF="000586.html">[pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py +</A></li> + <LI>Next message: <A HREF="000589.html">[pycrypto] documentation for PKCS1_PSS.py is incorrect, plus minor issue w/ _slowmath.py +</A></li> + <LI> <B>Messages sorted by:</B> + <a href="date.html#588">[ date ]</a> + <a href="thread.html#588">[ thread ]</a> + <a href="subject.html#588">[ subject ]</a> + <a href="author.html#588">[ author ]</a> + </LI> + </UL> + +<hr> +<a href="http://lists.dlitz.net/cgi-bin/mailman/listinfo/pycrypto">More information about the pycrypto +mailing list</a><br> +</body></html> |