Coverage Report

Created: 2020-11-21 08:34

/src/botan/build/include/botan/internal/des.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
* DES
3
* (C) 1999-2007 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#ifndef BOTAN_DES_H_
9
#define BOTAN_DES_H_
10
11
#include <botan/block_cipher.h>
12
13
namespace Botan {
14
15
/**
16
* DES
17
*/
18
class DES final : public Block_Cipher_Fixed_Params<8, 8>
19
   {
20
   public:
21
      void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
22
      void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
23
24
      void clear() override;
25
0
      std::string name() const override { return "DES"; }
26
0
      BlockCipher* clone() const override { return new DES; }
27
   private:
28
      void key_schedule(const uint8_t[], size_t) override;
29
30
      secure_vector<uint32_t> m_round_key;
31
   };
32
33
/**
34
* Triple DES
35
*/
36
class TripleDES final : public Block_Cipher_Fixed_Params<8, 16, 24, 8>
37
   {
38
   public:
39
      void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
40
      void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
41
42
      void clear() override;
43
568
      std::string name() const override { return "TripleDES"; }
44
0
      BlockCipher* clone() const override { return new TripleDES; }
45
   private:
46
      void key_schedule(const uint8_t[], size_t) override;
47
48
      secure_vector<uint32_t> m_round_key;
49
   };
50
51
/*
52
* DES Tables
53
*/
54
extern const uint32_t DES_SPBOX1[256];
55
extern const uint32_t DES_SPBOX2[256];
56
extern const uint32_t DES_SPBOX3[256];
57
extern const uint32_t DES_SPBOX4[256];
58
extern const uint32_t DES_SPBOX5[256];
59
extern const uint32_t DES_SPBOX6[256];
60
extern const uint32_t DES_SPBOX7[256];
61
extern const uint32_t DES_SPBOX8[256];
62
63
}
64
65
#endif