Talk:Montgomery modular multiplication

message: I think the final paragraph of this article looks suspiciously similar to part of the Handbook of Applied Cryptography's section on Montgomery reduction (chapter 14, section 14.3.2)  Being a newbie, I'm not sure what the "right thing" to do about this is.  AJR 01:05, 18 Apr 2005 (UTC)
thread_title: Untitled

message: We state that this is an algorithm, yet don't state what the algorithm is.  Can someone add this info?  --Doradus 16:47, 19 October 2007 (UTC)
thread_title:  What is the algorithm? 

message: Attacks on Montgomery modular multiplication are different from attacks on modular exponentiation.
[4] and [6] has nothing to do with attacks on Montgomery modular multiplication. They are about attacks on modular exponentiation.
Hers is a paper which describes attack on Montgomery modular multiplication: https://www.cdc.informatik.tu-darmstadt.de/reports/TR/TI-04-02.pdf
And this is (one way) how to avoid it.
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.32.3181&rep=rep1&type=pdf
Please correct the Wiki.
Thank you  — Preceding unsigned comment added by 75.80.164.200 (talk) 18:08, 8 April 2014 (UTC)
thread_title:  Attacks on Montgomery modular multiplication 

message: This appears on the page.
"To define multiplication, define the modular inverse of R, R^{-1} such that
    RR^{-1} \equiv 1 \pmod {N}
in other words
    RR^{-1} = kN + 1
where k is a positive integer. "
Does k have to be a positive integer? or just an integer? - either positive or negative?  I mean it seems to be the case in most crypto appplications, but it is not true in general.
: Good point. In the article, that phrase "where k is a positive integer" at that point seems only to throw up questions, and not to contribute information.
: Taken on its own and out of the context of the article, the statement A \equiv B \pmod {N} means of course that A = B + kN for any integer k.
: However, Montgomery in his 1983 paper restricts k to be 0 < k < R.  (He uses the notation N' for k.)  And then in his description of the Redc() function he writes N' where the Wikipedia article uses -N^{-1}.  I.e., Montgomery uses one and the same quantity (N') for what in the Wikipedia article as it is now is described as two independent quantities, k and -N^{-1}.
: I suspect that the phrase "where k is a positive integer" could have originated from a somewhat literal "copying" of Montgomery's paper.  Since the Wikipedia article doesn't use k in its definition of the Redc() function, I don't see how it matters in the "Rationale" section whether k is positive or not.  The restriction of k = N' = -N^{-1} to the interval 0 < N' < R seems to me irrelevant in the "Rationale" section, and seems to me not to contribute to that section.  I'd propose that that interval restriction, if it's important at all and can not simply be left unspecified, better be moved to the section "Description of Algorithm" (and there be phrased in terms of -N^{-1} and not k).
: In the section "Rationale", the phrase "RR^{-1} = kN + 1 where k is [a positive] integer" seems to have as its only function to put R R^{-1} \equiv 1 \pmod {N} in the form of the "Bezout's identity" theorem, which doesn't restrict the coefficient k to be positive.  So I'd say that inside the section "Rationale" it would create a more understandable text if the phrase "where k is a positive integer" is replaced by "where k is any integer" or "an integer", or if it is left out altogether. --MRaccoon (talk) 19:08, 24 March 2015 (UTC)
thread_title:  Is this true? 

message: I think that the title of the article should be changed from "Montgomery reduction" to "Montgomery multiplication".
One of the largest problems with this article is IMO the confusion between the following terms:
* Montgomery algorithm;
* The Redc() function (or algorithm);
* Montgomery step;
* Montgomery multiplication.
Clearly, Montgomery multiplication is the topic that the whole thing is about.  The purpose of the Redc() function and all the Montgomery stuff is to speed up multiplication (without damaging other operations like addition).  That the purpose is to speed up multiplication is also clear from Montgomery's 1983 paper (which is not only about the Redc() reduction function, but also about the complete fast multiplication design as a whole).
The Montgomery reduction -- i.e. the theoretical TR^{-1} mod N or its calculation via the Redc() algorithm --  is only a part of the Montgomery multiplication "package".  (It is an important part, but it is only a part.)  "Montgomery reduction" makes sense only as a part of Montgomery multiplication, as a "subroutine" inside the Montgomery multiplication "application".  It is not an algorithm that you can take out of Montgomery multiplication and apply elsewhere.
To explain Montgomery reduction, you cannot avoid explaining Montgomery multiplication as a whole (as the article already does).  So a logical and instructive exposition has to have as its scope: Montgomery multiplication as a whole.  To make things easier to understand and follow for the reader (and to avoid instilling misunderstandings), this scope has to be reflected in the article title.
At present, the article explains both Montgomery multiplication and Montgomery reduction (which is entirely right).  But it does so under the label of "Montgomery reduction".  It is as if on the animal species of the Sardinian Dwarf Mammoth, there existed no article with the title "Sardinian Dwarf Mammoth", but only an article with the title "Intestines of the Sardinian Dwarf Mammoth", with the latter article explaining everything about this Mammoth, including its intestines, but also everything else.  The article is about the whole, but the title confusingly gives the impression that the article is only about one part.
Incidentally: There is also confusion about the term "Montgomery algorithm".  The subject matter includes TWO algorithms, inside each other.  One is the Redc() algorithm, which is an inner subroutine, used inside the larger "Montgomery multiplication step" algorithm.  Both of these are algorithms.  To talk about "THE" Montgomery algorithm (unqualifiedly) is ambiguous and therefore confusing.  The article should explicitly state this fact that the subject matter includes two algorithms (one inside the other), and should identify each of these two algorithms explicitly (and should use clear and unambiguous names for each of the two algorithms).   --MRaccoon (talk) 22:14, 24 March 2015 (UTC)
replies: text: This issue has now been RESOLVED.  The article has been renamed, as discussed in Wikipedia_talk:WikiProject_Mathematics#Article_.22Montgomery_reduction.22:_Change_its_presentation_to_.22Montgomery_multiplication.22.  I am currently in the process of rewriting the lead text.  I will make sure that no information is lost by my edits.  --MRaccoon (talk) 10:56, 14 April 2015 (UTC)
thread_title:  Proposal: Change article title to "Montgomery multiplication" 

message: 09:27, 29 October 2015 (UTC)
replies: text: It looks strange to me too, but I don't have time right now to check the whole loop.  I will look at it more later.  Or, if you think you know how to correct the example, you can edit the article yourself.  Ozob (talk) 13:45, 29 October 2015 (UTC)
replies: text: Many of the carries were wrong, but the rest of the computation appears to have been correct.  I believe I have fixed the article.  Please let me know if you encounter any more problems.  Ozob (talk) 02:34, 30 October 2015 (UTC)
thread_title:  Error?