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

randombit / botan / 12319444587

13 Dec 2024 04:34PM UTC coverage: 91.266% (+0.005%) from 91.261%
12319444587

Pull #4475

github

web-flow
Merge 0365f2a25 into 281c77941
Pull Request #4475: Add a compile-time `hex_decode_array()`

93433 of 102374 relevant lines covered (91.27%)

11411688.47 hits per line

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

66.67
/src/lib/block/twofish/twofish.h
1
/*
2
* Twofish
3
* (C) 1999-2007 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7

8
#ifndef BOTAN_TWOFISH_H_
9
#define BOTAN_TWOFISH_H_
10

11
#include <botan/block_cipher.h>
12

13
#include <array>
14

15
namespace Botan {
16

17
/**
18
* Twofish, an AES finalist
19
*/
20
class Twofish final : public Block_Cipher_Fixed_Params<16, 16, 32, 8> {
×
21
   public:
22
      void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
23
      void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
24

25
      void clear() override;
26

27
      std::string name() const override { return "Twofish"; }
8,946✔
28

29
      std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<Twofish>(); }
2,702✔
30

31
      bool has_keying_material() const override;
32

33
   private:
34
      void key_schedule(std::span<const uint8_t> key) override;
35

36
      static const std::array<uint32_t, 256> MDS0;
37
      static const std::array<uint32_t, 256> MDS1;
38
      static const std::array<uint32_t, 256> MDS2;
39
      static const std::array<uint32_t, 256> MDS3;
40
      static const std::array<uint8_t, 256> Q0;
41
      static const std::array<uint8_t, 256> Q1;
42
      static const std::array<uint8_t, 32> RS;
43
      static const std::array<uint8_t, 255> EXP_TO_POLY;
44
      static const std::array<uint8_t, 255> POLY_TO_EXP;
45

46
      secure_vector<uint32_t> m_SB, m_RK;
47
};
48

49
}  // namespace Botan
50

51
#endif
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

© 2025 Coveralls, Inc