File: encrypt_stream.cpp

package info (click to toggle)
entropybroker 2.9-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,600 kB
  • sloc: cpp: 14,386; sh: 934; makefile: 188; java: 148; perl: 12
file content (36 lines) | stat: -rw-r--r-- 688 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <string.h>
#include <string>

#include "error.h"
#include "encrypt_stream.h"
#include "encrypt_stream_3des.h"
#include "encrypt_stream_aes.h"
#include "encrypt_stream_blowfish.h"
#include "encrypt_stream_camellia.h"

encrypt_stream::encrypt_stream()
{
}

encrypt_stream::~encrypt_stream()
{
}

encrypt_stream * encrypt_stream::select_cipher(std::string type)
{
	if (type == "3des")
		return new encrypt_stream_3des();

	if (type == "aes")
		return new encrypt_stream_aes();

	if (type == "blowfish")
		return new encrypt_stream_blowfish();

	if (type == "camellia")
		return new encrypt_stream_camellia();

	error_exit("Cipher '%s' is not known", type.c_str());

	return NULL;
}