@@ -44,8 +44,8 @@ namespace hurchalla {
44
44
// 0 < modulus < (1 << 64)/4. It is undefined behavior to use a modulus that is
45
45
// not within the allowed range. The modulus you use must be odd, which is
46
46
// always required for montgomery arithmetic.
47
- // In contrast, the default class MontgomeryForm<T> has no restriction on the
48
- // its modulus size, aside from requiring that its modulus must be a positive
47
+ // In contrast, the default class MontgomeryForm<T> has no restriction on its
48
+ // modulus size, though it still requires that its modulus must be a positive
49
49
// odd number.
50
50
// You can expect that MontgomeryQuarter<T> will perform better (very often) or
51
51
// at worst the same as MontgomeryForm<T>, if both are given the same modulus.
@@ -64,8 +64,8 @@ namespace hurchalla {
64
64
// to use a modulus that is not within the allowed range. The modulus you use
65
65
// must be odd, which is always required for montgomery arithmetic.
66
66
// In contrast, the default class MontgomeryForm<T> has no restriction on its
67
- // modulus size, aside from requiring that its modulus must be a positive odd
68
- // number.
67
+ // modulus size, though it still requires that its modulus must be a positive
68
+ // odd number.
69
69
// For a type T that is the same size as the CPU integer registers (e.g.
70
70
// uin64_t on a 64 bit computer) or a type T that is smaller than the register
71
71
// size, you can expect that MontgomeryHalf<T> will perform better (very often)
@@ -92,8 +92,10 @@ namespace hurchalla {
92
92
// Note that this file also has an alias called MontgomeryStandardMathWrapper.
93
93
// This alias maps to a class that uses the MontgomeryForm interface but that
94
94
// internally performs all calculations with standard modular arithmetic rather
95
- // than any montgomery arithmetic. This can be useful as an aid for comparing
96
- // performance between montgomery and non-montgomery modular arithmetic.
95
+ // than any montgomery arithmetic. This can be useful as a convenient aid to
96
+ // compare performance between montgomery and non-montgomery modular arithmetic,
97
+ // since the fact that these aliases both provide the exact same API allows you
98
+ // to use them interchangably via a function/struct/class template parameter.
97
99
// Since MontgomeryStandardMathWrapper does not use montgomery arithmetic, its
98
100
// modulus is allowed to be either even or odd. Its modulus must be positive.
99
101
//
@@ -140,8 +142,8 @@ using MontgomeryFull = MontgomeryForm<T,
140
142
// standard modular arithmetic whenever a large amount of modular multiplication
141
143
// is needed, and so this is probably unlikely to be an alias you would expect
142
144
// to use. However, CPU architectures vary and evolve, and what is true today
143
- // may not be true tomorrow - the only way to know what is fastest on a given
144
- // system is to measure and compare performance .
145
+ // may not be true tomorrow - you will need to measure and compare performance
146
+ // on your system to know for certain .
145
147
template <typename T>
146
148
using MontgomeryStandardMathWrapper = MontgomeryForm<T,
147
149
detail::MontyWrappedStandardMath<typename extensible_make_unsigned<T>::type>>;
0 commit comments