Skip to content

Commit 19b9741

Browse files
Jeffrey HurchallaJeffrey Hurchalla
authored andcommitted
change montgomery_two_pow function parameters to pass by const reference
1 parent 4b19fea commit 19b9741

File tree

1 file changed

+2
-2
lines changed
  • montgomery_arithmetic/include/hurchalla/montgomery_arithmetic/detail/experimental/montgomery_two_pow

1 file changed

+2
-2
lines changed

montgomery_arithmetic/include/hurchalla/montgomery_arithmetic/detail/experimental/montgomery_two_pow/montgomery_two_pow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace hurchalla {
3030
// of the normal k-ary algorithm.
3131
//
3232
template <class MF, typename U>
33-
typename MF::MontgomeryValue montgomery_two_pow(MF mf, U n)
33+
typename MF::MontgomeryValue montgomery_two_pow(const MF& mf, U n)
3434
{
3535
static_assert(ut_numeric_limits<U>::is_integer);
3636
static_assert(!ut_numeric_limits<U>::is_signed);
@@ -107,7 +107,7 @@ typename MF::MontgomeryValue montgomery_two_pow(MF mf, U n)
107107

108108
template <class MF, typename U, size_t ARRAY_SIZE>
109109
std::array<typename MF::MontgomeryValue, ARRAY_SIZE>
110-
array_montgomery_two_pow(std::array<MF, ARRAY_SIZE> mf, std::array<U, ARRAY_SIZE> n)
110+
array_montgomery_two_pow(const std::array<MF, ARRAY_SIZE>& mf, const std::array<U, ARRAY_SIZE>& n)
111111
{
112112
static_assert(ut_numeric_limits<U>::is_integer);
113113
static_assert(!ut_numeric_limits<U>::is_signed);

0 commit comments

Comments
 (0)