<commit_before>/*
* (C) 2016 <NAME>
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#include "tests.h"

#if defined(BOTAN_HAS_FPE_FE1)
  #include <botan/fpe_fe1.h>
#endif

namespace Botan_Tests {

class FPE_FE1_Tests : public Text_Based_Test
   {
   public:
      FPE_FE1_Tests() : Text_Based_Test("fpe_fe1.vec", {"Mod", "In", "Out", "Key", "Tweak"}) {}

      Test::Result run_one_test(const std::string& algo, const VarMap& vars) override
         {
         const Botan::BigInt modulus  = get_req_bn(vars, "Mod");
         const Botan::BigInt input    = get_req_bn(vars, "In");
         const Botan::BigInt expected = get_req_bn(vars, "Out");
         const std::vector<uint8_t> key      = get_req_bin(vars, "Key");
         const std::vector<uint8_t> tweak    = get_req_bin(vars, "Tweak");

         Test::Result result("FPE_FE1");

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

         result.test_eq("ciphertext", got, expected);

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

         result.test_eq("decrypted", decry, input);

         return result;
         }

   };

BOTAN_REGISTER_TEST("fpe_fe1", FPE_FE1_Tests);

}
<commit_msg>Add missing guard<commit_after>/*
* (C) 2016 <NAME>
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#include "tests.h"

#if defined(BOTAN_HAS_FPE_FE1)
  #include <botan/fpe_fe1.h>
#endif

namespace Botan_Tests {

#if defined(BOTAN_HAS_FPE_FE1)

class FPE_FE1_Tests : public Text_Based_Test
   {
   public:
      FPE_FE1_Tests() : Text_Based_Test("fpe_fe1.vec", {"Mod", "In", "Out", "Key", "Tweak"}) {}

      Test::Result run_one_test(const std::string& algo, const VarMap& vars) override
         {
         const Botan::BigInt modulus  = get_req_bn(vars, "Mod");
         const Botan::BigInt input    = get_req_bn(vars, "In");
         const Botan::BigInt expected = get_req_bn(vars, "Out");
         const std::vector<uint8_t> key      = get_req_bin(vars, "Key");
         const std::vector<uint8_t> tweak    = get_req_bin(vars, "Tweak");

         Test::Result result("FPE_FE1");

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

         result.test_eq("ciphertext", got, expected);

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

         result.test_eq("decrypted", decry, input);

         return result;
         }

   };

BOTAN_REGISTER_TEST("fpe_fe1", FPE_FE1_Tests);

#endif

}

{'fraction_non_alphanumeric': 0.1422986708365911, 'fraction_numerical': 0.012900703674745896, 'mean_word_length': 3.3668941979522184, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1643885', 'n_tokens_mistral': 969, 'n_tokens_neox': 932, 'n_words': 193}