• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 14606431966

22 Apr 2025 11:19PM UTC coverage: 91.416% (+0.1%) from 91.316%
14606431966

Pull #4835

github

web-flow
Merge f63084710 into 4c413a8ac
Pull Request #4835: New Barrett Reduction implementation

95800 of 104796 relevant lines covered (91.42%)

13215574.08 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/lib/math/numbertheory/reducer.cpp
1
/*
2
* Modular Reducer
3
* (C) 1999-2011,2018,2025 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7

8
#include <botan/reducer.h>
9

10
#include <botan/internal/divide.h>
11

12
namespace Botan {
13

14
Modular_Reducer::Modular_Reducer(const BigInt& mod) {
×
15
   if(mod < 0) {
×
16
      throw Invalid_Argument("Modular_Reducer: modulus must be positive");
×
17
   }
18

19
   m_modulus = mod;
×
20
}
×
21

22
BigInt Modular_Reducer::reduce(const BigInt& x) const {
×
23
   return ct_modulo(x, m_modulus);
×
24
}
25

26
}  // namespace Botan
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc