Botan 3.6.1
Crypto and TLS for C&
des.h
Go to the documentation of this file.
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
13namespace Botan {
14
15/**
16* DES
17*/
18class DES final : public Block_Cipher_Fixed_Params<8, 8> {
19 public:
20 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
21 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
22
23 void clear() override;
24
25 std::string name() const override { return "DES"; }
26
27 std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<DES>(); }
28
29 bool has_keying_material() const override;
30
31 private:
32 void key_schedule(std::span<const uint8_t>) override;
33
34 secure_vector<uint32_t> m_round_key;
35};
36
37/**
38* Triple DES
39*/
40class TripleDES final : public Block_Cipher_Fixed_Params<8, 16, 24, 8> {
41 public:
42 void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
43 void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override;
44
45 void clear() override;
46
47 std::string name() const override { return "TripleDES"; }
48
49 std::unique_ptr<BlockCipher> new_object() const override { return std::make_unique<TripleDES>(); }
50
51 bool has_keying_material() const override;
52
53 private:
54 void key_schedule(std::span<const uint8_t>) override;
55
56 secure_vector<uint32_t> m_round_key;
57};
58
59} // namespace Botan
60
61#endif
std::unique_ptr< BlockCipher > new_object() const override
Definition des.h:27
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition des.cpp:249
void clear() override
Definition des.cpp:340
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition des.cpp:290
std::string name() const override
Definition des.h:25
bool has_keying_material() const override
Definition des.cpp:328
void decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition des.cpp:394
void clear() override
Definition des.cpp:457
std::unique_ptr< BlockCipher > new_object() const override
Definition des.h:49
bool has_keying_material() const override
Definition des.cpp:438
void encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const override
Definition des.cpp:347
std::string name() const override
Definition des.h:47
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61