Skip to content

Commit

Permalink
Fixed RNSBase::extend(const RNSBase &other), github issue #210.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wei Dai committed Aug 31, 2020
1 parent 759c8cd commit b0f02d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion native/src/seal/util/rns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ namespace seal
// The bases must be coprime
for (size_t i = 0; i < other.size_; i++)
{
for (size_t j = 0; j < i; j++)
for (size_t j = 0; j < size_; j++)
{
if (!are_coprime(other[i].value(), base_[j].value()))
{
Expand Down
2 changes: 1 addition & 1 deletion native/tests/seal/util/rns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace sealtest
ASSERT_EQ(Modulus(13), base6[5]);
ASSERT_EQ(Modulus(17), base6[6]);

ASSERT_THROW(auto base7 = base4.extend(RNSBase({ 7, 11, 15 }, pool)), logic_error);
ASSERT_THROW(auto base7 = base4.extend(RNSBase({ 7, 10, 11 }, pool)), invalid_argument);
}

TEST(RNSBaseTest, Drop)
Expand Down

0 comments on commit b0f02d4

Please sign in to comment.