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

randombit / botan / 23234035284

18 Mar 2026 07:35AM UTC coverage: 89.676% (+0.002%) from 89.674%
23234035284

Pull #5459

github

web-flow
Merge ad389837e into a7cbacbd5
Pull Request #5459: Added utf8_to_ucs2 and utf8_to_ucs4

104505 of 116536 relevant lines covered (89.68%)

11690135.13 hits per line

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

93.33
/src/tests/test_fpe.cpp
1
/*
2
* (C) 2016 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6

7
#include "tests.h"
8

9
#if defined(BOTAN_HAS_FPE_FE1)
10
   #include <botan/fpe_fe1.h>
11
#endif
12

13
namespace Botan_Tests {
14

15
namespace {
16

17
#if defined(BOTAN_HAS_FPE_FE1)
18

19
class FPE_FE1_Tests final : public Text_Based_Test {
×
20
   public:
21
      FPE_FE1_Tests() : Text_Based_Test("fpe_fe1.vec", "Mod,In,Out,Key,Tweak") {}
2✔
22

23
      Test::Result run_one_test(const std::string& /*header*/, const VarMap& vars) override {
5✔
24
         const Botan::BigInt modulus = vars.get_req_bn("Mod");
5✔
25
         const Botan::BigInt input = vars.get_req_bn("In");
5✔
26
         const Botan::BigInt expected = vars.get_req_bn("Out");
5✔
27
         const auto key = Botan::SymmetricKey(vars.get_req_bin("Key"));
5✔
28
         const std::vector<uint8_t> tweak = vars.get_req_bin("Tweak");
5✔
29

30
         Test::Result result("FPE_FE1");
5✔
31

32
         const Botan::BigInt got = Botan::FPE::fe1_encrypt(modulus, input, key, tweak);
5✔
33

34
         result.test_bn_eq("ciphertext", got, expected);
5✔
35

36
         const Botan::BigInt decry = Botan::FPE::fe1_decrypt(modulus, got, key, tweak);
5✔
37

38
         result.test_bn_eq("decrypted", decry, input);
5✔
39

40
         return result;
5✔
41
      }
15✔
42
};
43

44
BOTAN_REGISTER_TEST("misc", "fpe_fe1", FPE_FE1_Tests);
45

46
#endif
47

48
}  // namespace
49

50
}  // namespace Botan_Tests
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