4 * @brief Generic constructor for crypter_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 #include <crypto/crypters/aes_cbc_crypter.h>
30 * String mappings for encryption_algorithm_t.
32 mapping_t encryption_algorithm_m
[] = {
33 {ENCR_UNDEFINED
, "ENCR_UNDEFINED"},
34 {ENCR_DES_IV64
, "ENCR_DES_IV64"},
35 {ENCR_DES
, "ENCR_DES"},
36 {ENCR_3DES
, "ENCR_3DES"},
37 {ENCR_RC5
, "ENCR_RC5"},
38 {ENCR_IDEA
, "ENCR_IDEA"},
39 {ENCR_CAST
, "ENCR_CAST"},
40 {ENCR_BLOWFISH
, "ENCR_BLOWFISH"},
41 {ENCR_3IDEA
, "ENCR_3IDEA"},
42 {ENCR_DES_IV32
, "ENCR_DES_IV32"},
43 {ENCR_NULL
, "ENCR_NULL"},
44 {ENCR_AES_CBC
, "ENCR_AES_CBC"},
45 {ENCR_AES_CTR
, "ENCR_AES_CTR"},
50 * Described in header.
52 crypter_t
*crypter_create(encryption_algorithm_t encryption_algorithm
, size_t key_size
)
54 switch (encryption_algorithm
)
58 return (crypter_t
*)aes_cbc_crypter_create(key_size
);